From 530eeba855414d098ef61b84c8d770076e73ef3f Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Mon, 28 Jan 2019 22:30:01 -0500 Subject: [PATCH] Add test for user drafts stream Followup to 84a3da4b18d6dd5c2a0940fe04b339ebc1605123 --- .../acceptance/user-drafts-stream-test.js.es6 | 12 ++++++++++++ test/javascripts/fixtures/drafts.js.es6 | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/javascripts/acceptance/user-drafts-stream-test.js.es6 diff --git a/test/javascripts/acceptance/user-drafts-stream-test.js.es6 b/test/javascripts/acceptance/user-drafts-stream-test.js.es6 new file mode 100644 index 00000000000..06f7d9f4d2a --- /dev/null +++ b/test/javascripts/acceptance/user-drafts-stream-test.js.es6 @@ -0,0 +1,12 @@ +import { acceptance } from "helpers/qunit-helpers"; + +acceptance("User Drafts", { loggedIn: true }); + +QUnit.test("Stream", async assert => { + await visit("/u/eviltrout/activity/drafts"); + assert.ok(find(".user-stream-item").length === 3, "has drafts"); + + await click(".user-stream-item:last-child .remove-draft"); + assert.ok(find(".user-stream-item").length === 2, "draft removed, list length diminished by one"); + +}); diff --git a/test/javascripts/fixtures/drafts.js.es6 b/test/javascripts/fixtures/drafts.js.es6 index 8aaa88289c3..f5f31958f6e 100644 --- a/test/javascripts/fixtures/drafts.js.es6 +++ b/test/javascripts/fixtures/drafts.js.es6 @@ -43,7 +43,7 @@ export default { excerpt: "here goes a reply to a PM.", created_at: "2018-07-20T16:58:47.433Z", draft_key: "topic_93", - sequence: 1, + sequence: 0, draft_username: "eviltrout", avatar_template: "/user_avatar/localhost/eviltrout/{size}/2_1.png", data: