Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-074

Reply, resolve, reopen and delete change the named thread only, and a malformed message changes nothing

When the host handles a reply, resolve or delete message for a thread of the review comments file, the extension SHALL append the comment, set the resolved flag or remove the thread of that name only and change no other thread, and refuse with a reason and write nothing when that thread does not exist or already holds 200 comments; a reply, resolve or delete message is dropped without an answer unless it has a non-empty thread id, a reply has a body of 1 to 10 000 characters and a resolve has a boolean resolved flag.

Step 2 of path 2 in StRS-MDOKFSTUDIO-REVIEW-003: from “The reply is sent to the host” to “The thread holds the reply”.

Scenarios 11

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

nominalReply
Giventwo threads and a reply to the first, sent from the thread popover
Whenthe host handles it
Thenthe first thread holds its comment and the reply, listed after the first comment, with author, id and time chosen by the host, and the second thread is unchanged
refusalA reply to an unknown or full thread
InputOutcome
A reply to the thread t_ffffffffThe page is told "the thread no longer exists or has too many comments." and the file is unchanged
A reply to a thread that holds 200 commentsThe change is refused with the same reason
nominalResolve and reopen
InputOutcome
The reader resolves an open thread and then reopens itThe file shows resolved true and then false and the other threads are unchanged
Three threads of which one is resolved, and another one is resolvedOnly that one changes
nominalDelete one of two
Giventwo threads
Whenone is deleted
Thenthe other stays in the file
boundaryDelete the last thread
Givena file with one thread
Whenit is deleted
Thenthe file stays with an empty threads list (threads []) and the page is told the list is empty
refusalA resolve or a delete of an unknown thread
InputOutcome
A delete for the thread t_ffffffffThe page is told ok false with kind delete and "the thread no longer exists.", and the file is unchanged
A resolve for an unknown threadThe same refusal is answered with kind resolve

The refusals of the host that apply to every comment change (a document that is not a saved file, a comments file with unsaved changes in an editor, the size and thread limits of the file) and the warning shown with them are in SwRS-MDOKFSTUDIO-REVIEW-054.

nominalValid reply message
Givena previewCommentReply message with a thread id and a body of 1 character
Whenthe message is validated
Thenit is accepted
refusalInvalid reply message
InputOutcome
An empty thread iddropped without an answer
A body of 0 charactersdropped without an answer
A body of 10 001 charactersdropped without an answer
boundaryAccepted limits of a reply message
InputOutcome
A body of 1 character, a body of 10 000 charactersaccepted
nominalValid resolve and delete messages
Givena previewCommentResolve message with a thread id and resolved true, and a previewCommentDelete message with a thread id
Whenthe messages are validated
Thenboth are accepted
refusalInvalid resolve and delete messages
InputOutcome
previewCommentResolve or previewCommentDelete with an empty thread iddropped without an answer
previewCommentResolve with a resolved flag that is not a booleandropped without an answer

Implemented in 3

Tested by 3

Replaces

SwRS-MDOKFSTUDIO-REVIEW-070A comment reply message names a thread and carries a bounded body superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-074 Markdown file
SwRS-MDOKFSTUDIO-REVIEW-071Resolve and delete messages name a thread; resolve carries a flag superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-074 Markdown file