refactor: 💅 Use common selector ALERT_TOAST_BODY across test suite (#2692)

* replace with alert toast body, replace with this.server.schema

* revert changes to db,schema

* use common selector, alert toast body

* replace ERROR_MSG_SELECTOR with common selector ALERT_TOAST_BODY
This commit is contained in:
Lauren authored and GitHub committed 2025-02-13 15:54:40 -05:00
1 parent 20c4bbcee2
commit f12ae90aba
45 files changed
+124 -138

No files matched your search

@@ -9,6 +9,7 @@ import { setupApplicationTest } from 'admin/tests/helpers';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import { Response } from 'miragejs';
import { authenticateSession } from 'ember-simple-auth/test-support';
import * as commonSelectors from 'admin/tests/helpers/selectors';
module('Acceptance | groups | delete', function (hooks) {
setupApplicationTest(hooks);
@@ -80,8 +81,6 @@ module('Acceptance | groups | delete', function (hooks) {
await visit(urls.group);
await click(MANAGE_DROPDOWN_SELECTOR);
await click(DELETE_ACTION_SELECTOR);
assert
.dom('[data-test-toast-notification] .hds-alert__description')
.hasText('Oops.');
assert.dom(commonSelectors.ALERT_TOAST_BODY).hasText('Oops.');
});
});
@@ -11,6 +11,7 @@ import { setupIndexedDb } from 'api/test-support/helpers/indexed-db';
import a11yAudit from 'ember-a11y-testing/test-support/audit';
import { Response } from 'miragejs';
import { authenticateSession } from 'ember-simple-auth/test-support';
import * as commonSelectors from 'admin/tests/helpers/selectors';
module('Acceptance | groups | members', function (hooks) {
setupApplicationTest(hooks);
@@ -100,7 +101,7 @@ module('Acceptance | groups | members', function (hooks) {
await click('.hds-dropdown-toggle-icon');
await click('tbody tr .hds-dropdown-list-item button');
assert
.dom('[data-test-toast-notification] .hds-alert__description')
.dom(commonSelectors.ALERT_TOAST_BODY)
.hasText('The request was invalid.');
});
@@ -174,7 +175,7 @@ module('Acceptance | groups | members', function (hooks) {
await click('tbody label');
await click('form [type="submit"]');
assert
.dom('[data-test-toast-notification] .hds-alert__description')
.dom(commonSelectors.ALERT_TOAST_BODY)
.hasText('The request was invalid.');
});
});
@@ -9,6 +9,7 @@ import { setupApplicationTest } from 'admin/tests/helpers';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import { Response } from 'miragejs';
import { authenticateSession } from 'ember-simple-auth/test-support';
import * as commonSelectors from 'admin/tests/helpers/selectors';
module('Acceptance | groups | update', function (hooks) {
setupApplicationTest(hooks);
@@ -92,7 +93,7 @@ module('Acceptance | groups | update', function (hooks) {
await fillIn('[name="name"]', 'random string');
await click('[type="submit"]');
assert
.dom('[data-test-toast-notification] .hds-alert__description')
.dom(commonSelectors.ALERT_TOAST_BODY)
.hasText('The request was invalid.');
assert.strictEqual(
find('[data-test-error-message-name]').textContent.trim(),