mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
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:
@ -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"
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user