Skip to content

Commit

Permalink
refactor update-test
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenolivia committed Dec 12, 2024
1 parent d9b57b0 commit 21d5db6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion ui/admin/tests/acceptance/targets/host-sources-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ module('Acceptance | targets | host-sources', function (hooks) {

await click('tbody label');
await click('form [type="submit"]');
// await this.pauseTest();

assert.dom(commonSelectors.MODAL_WARNING).exists;
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN);
Expand Down
17 changes: 9 additions & 8 deletions ui/admin/tests/acceptance/targets/update-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import { setupIndexedDb } from 'api/test-support/helpers/indexed-db';
import { Response } from 'miragejs';
import { authenticateSession } from 'ember-simple-auth/test-support';
import * as commonSelectors from 'admin/tests/helpers/selectors';

module('Acceptance | targets | update', function (hooks) {
setupApplicationTest(hooks);
Expand Down Expand Up @@ -135,9 +136,9 @@ module('Acceptance | targets | update', function (hooks) {

await click(`[href="${urls.targets}"]`);

assert.dom('.rose-dialog').exists();
assert.dom(commonSelectors.MODAL_WARNING).exists;

await click('.rose-dialog-footer button:first-child', 'Click Discard');
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN);

assert.strictEqual(currentURL(), urls.targets);
assert.notEqual(this.server.schema.targets.first().name, 'random string');
Expand All @@ -155,8 +156,8 @@ module('Acceptance | targets | update', function (hooks) {

assert.strictEqual(currentURL(), urls.target);
await click(`[href="${urls.targets}"]`);
assert.dom('.rose-dialog').exists();
await click('.rose-dialog-footer button:last-child', 'Click Cancel');
assert.dom(commonSelectors.MODAL_WARNING).exists;
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN);

assert.strictEqual(currentURL(), urls.target);
assert.notEqual(this.server.schema.targets.first().name, 'random string');
Expand Down Expand Up @@ -208,8 +209,8 @@ module('Acceptance | targets | update', function (hooks) {
await fillIn('[name="address"]', '0.0.0.0');
await click('[type="submit"]');

assert.dom('.rose-dialog').isVisible();
await click('.rose-dialog-footer .rose-button-primary', 'Remove resources');
assert.dom(commonSelectors.MODAL_WARNING).exists;
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN);

assert.strictEqual(
this.server.schema.targets.find(target.id).address,
Expand Down Expand Up @@ -253,8 +254,8 @@ module('Acceptance | targets | update', function (hooks) {
await fillIn('[name="address"]', '0.0.0.0');
await click('[type="submit"]');

assert.dom('.rose-dialog').isVisible();
await click('.rose-dialog-footer .rose-button-secondary', 'Cancel');
assert.dom(commonSelectors.MODAL_WARNING).exists;
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN);

assert.strictEqual(
this.server.schema.targets.find(target.id).address,
Expand Down

0 comments on commit 21d5db6

Please sign in to comment.