FEATURE: Check if draft exists before starting a new one (#6755)

Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com>
Co-Authored-By: zogstrip <regis@hanol.fr>
This commit is contained in:
Joffrey JAFFEUX
2018-12-12 10:21:51 +01:00
committed by GitHub
parent 0ca61242b8
commit 3a799ed922
5 changed files with 159 additions and 58 deletions

View File

@ -41,10 +41,18 @@ QUnit.test("Viewing Summary", async assert => {
});
QUnit.test("Viewing Drafts", async assert => {
// prettier-ignore
server.get("/draft.json", () => { // eslint-disable-line no-undef
return [ 200, { "Content-Type": "application/json" }, {
draft: "{\"reply\":\"This is a draft of the first post\",\"action\":\"reply\",\"categoryId\":1,\"archetypeId\":\"regular\",\"metaData\":null,\"composerTime\":2863,\"typingTime\":200}",
draft_sequence: 42
} ];
});
await visit("/u/eviltrout/activity/drafts");
assert.ok(exists(".user-stream"), "has drafts stream");
assert.ok(
$(".user-stream .user-stream-item-draft-actions").length,
exists(".user-stream .user-stream-item-draft-actions"),
"has draft action buttons"
);