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.
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
| Input | Outcome |
|---|
| A reply to the thread t_ffffffff | The 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 comments | The change is refused with the same reason |
nominalResolve and reopen
| Input | Outcome |
|---|
| The reader resolves an open thread and then reopens it | The file shows resolved true and then false and the other threads are unchanged |
| Three threads of which one is resolved, and another one is resolved | Only 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
| Input | Outcome |
|---|
| A delete for the thread t_ffffffff | The page is told ok false with kind delete and "the thread no longer exists.", and the file is unchanged |
| A resolve for an unknown thread | The 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
| Input | Outcome |
|---|
| An empty thread id | dropped without an answer |
| A body of 0 characters | dropped without an answer |
| A body of 10 001 characters | dropped without an answer |
boundaryAccepted limits of a reply message
| Input | Outcome |
|---|
| A body of 1 character, a body of 10 000 characters | accepted |
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
| Input | Outcome |
|---|
| previewCommentResolve or previewCommentDelete with an empty thread id | dropped without an answer |
| previewCommentResolve with a resolved flag that is not a boolean | dropped without an answer |