Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-125

A renamed document takes its review comments file along

When a document is renamed or moved, the extension SHALL rename its comments file to the new name and set the document name inside it, and leave every comments file where it is, never overwriting one, when the move is not safe.

Step 1 of path 2 in StRS-MDOKFSTUDIO-REVIEW-008: from “A document is renamed or moved” to “The comments file follows the document”.

Scenarios 6

The situations the tests check; open one to read it.

nominalRename
Givenmove-me.md with move-me.comments.json holding thread m1
Whenthe document is renamed to moved.md
Thenmoved.comments.json exists with the thread m1 and move-me.comments.json is gone
nominalMove to another folder
Giventhe same document moved to another folder
Whenthe move happens
Thenthe comments file moves with it
refusalA rename never overwrites a comments file
InputOutcome
keep.md renamed to target2.md while target2.comments.json existsBoth comments files keep their content and the warning "The review comments of {old} stay in {file}: {reason}" says target2.comments.json already exists
The old comments file is not validThe file stays under its old name and the same warning gives the reason
The old comments file is open with unsaved changesThe file stays under its old name and the same warning gives the reason
refusalA comments file that names another document
Givenmove-me.comments.json whose document field says other.md
Whenmove-me.md is renamed
Thenthe file stays and no warning is shown
nominalOwn document
Givena comments file whose document field names the renamed document
Whenthe document is renamed
Thenthe file moves
boundaryRenames that move nothing
InputOutcome
A folder is renamedNo comments file is moved
A file named x.comments.json is renamedNothing is moved
A file that is not local is renamedNo comments file is moved

Implemented in 1

Tested by 2