DEV: update tests for user-notes-modal
This commit is contained in:
parent
68a7b8c0e3
commit
b0f92d9e82
|
@ -1,5 +1,5 @@
|
||||||
<DButton
|
<DButton
|
||||||
@class="btn btn-default"
|
@class="btn btn-default show-user-notes-btn"
|
||||||
@action={{@show}}
|
@action={{@show}}
|
||||||
@icon="pencil-alt"
|
@icon="pencil-alt"
|
||||||
@translatedLabel={{this.label}}
|
@translatedLabel={{this.label}}
|
||||||
|
|
|
@ -41,22 +41,25 @@ acceptance("User Notes", function (needs) {
|
||||||
test("creates note from user's profile", async function (assert) {
|
test("creates note from user's profile", async function (assert) {
|
||||||
await visit("/admin/users/1/eviltrout");
|
await visit("/admin/users/1/eviltrout");
|
||||||
|
|
||||||
assert.dom(".user-controls button").hasText(I18n.t("user_notes.title"));
|
const modalClass = ".user-notes-modal .d-modal__container";
|
||||||
assert.dom(".user-notes-modal.modal-body").isNotVisible();
|
assert
|
||||||
|
.dom(".user-controls .show-user-notes-btn")
|
||||||
|
.hasText(I18n.t("user_notes.title"));
|
||||||
|
assert.dom(modalClass).isNotVisible();
|
||||||
|
|
||||||
await click(".user-controls button");
|
await click(".user-controls .show-user-notes-btn");
|
||||||
|
|
||||||
assert.dom(".user-notes-modal.modal-body").isVisible();
|
assert.dom(modalClass).isVisible();
|
||||||
|
|
||||||
await fillIn(".user-notes-modal textarea", "Helpful user");
|
await fillIn(`${modalClass} textarea`, "Helpful user");
|
||||||
|
|
||||||
assert.dom(".user-notes-modal.modal-body button").isEnabled();
|
assert.dom(`${modalClass} .btn-primary`).isEnabled();
|
||||||
|
|
||||||
await click(".user-notes-modal.modal-body button");
|
await click(`${modalClass} .btn-primary`);
|
||||||
await click(".user-notes-modal button.modal-close");
|
await click(`${modalClass} .modal-close`);
|
||||||
|
|
||||||
assert
|
assert
|
||||||
.dom(".user-controls button")
|
.dom(".user-controls .show-user-notes-btn")
|
||||||
.hasText(I18n.t("user_notes.show", { count: 1 }));
|
.hasText(I18n.t("user_notes.show", { count: 1 }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue