Skip to content

Commit 1fe0d8b

Browse files
committed
refactor: the tests of project page
1 parent 2404e48 commit 1fe0d8b

File tree

1 file changed

+8
-28
lines changed

1 file changed

+8
-28
lines changed

frontend/tests/acceptance/project-test.js

+8-28
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,15 @@ module("Acceptance | projects", function (hooks) {
8282

8383
await click("[data-test-save]");
8484

85+
await click("[data-test-task-table-row]");
86+
assert.dom("[data-test-name]").hasValue("FooBar Task 1");
87+
assert.dom("[data-test-reference]").hasValue("Reference of FooBar Task 1");
88+
assert.dom("[data-test-estimated-time]").hasValue("02:15");
89+
8590
assert.dom("[data-test-task-table-row]").exists({ count: 1 });
91+
92+
await click("[data-test-cancel]");
93+
assert.dom("[data-test-task-form]").doesNotExist();
8694
});
8795

8896
test("can edit task", async function (assert) {
@@ -141,34 +149,6 @@ module("Acceptance | projects", function (hooks) {
141149
assert.dom("[data-test-table-archived]").hasClass("fa-square-check");
142150
});
143151

144-
test("The cancel button will hide the form", async function (assert) {
145-
await visit("/projects");
146-
assert.strictEqual(currentURL(), "/projects");
147-
148-
await selectChoose(
149-
"[data-test-customer-selection]",
150-
".ember-power-select-option",
151-
0,
152-
);
153-
154-
await selectChoose(
155-
"[data-test-project-selection]",
156-
".ember-power-select-option",
157-
0,
158-
);
159-
160-
assert.dom("[data-test-add-task]").exists();
161-
assert.dom("[data-test-task-table-row]").doesNotExist();
162-
163-
await click("[data-test-add-task]");
164-
assert.dom("[data-test-task-form]").exists();
165-
assert.dom("[data-test-save]").isDisabled();
166-
167-
await click("[data-test-cancel]");
168-
169-
assert.dom("[data-test-task-form]").doesNotExist();
170-
});
171-
172152
test("shows all customers to superuser", async function (assert) {
173153
const user = this.server.create("user", { isSuperuser: true });
174154
this.server.create("project");

0 commit comments

Comments
 (0)