refactor: 💅 Aliases: read-test (#2691)
* refactor: 💡 Read aliases test suite Refactor tests for read aliases test suite ✅ Closes: ICU-15455 * replace with alert toast body, replace with this.server.schema * revert change * revert oidc test * revert roles, create-test * add const to commonSelectors file, revert selectors file * rename selector * use TABLE_RESOURCE_LINK common selector * fix test failure
This commit is contained in:
1 parent
750cc1ecae
commit
83fa213854
1 file changed
+6
-8
@@ -17,8 +17,6 @@ module('Acceptance | aliases | read', function (hooks) {
|
||||
setupMirage(hooks);
|
||||
setupIndexedDb(hooks);
|
||||
|
||||
const TABLE_LINK_SELECTOR = '.hds-table__tbody tr:first-child a';
|
||||
|
||||
const instances = {
|
||||
scopes: {
|
||||
global: null,
|
||||
@@ -51,26 +49,26 @@ module('Acceptance | aliases | read', function (hooks) {
|
||||
await authenticateSession({ username: 'admin' });
|
||||
});
|
||||
|
||||
test('visiting a alias', async function (assert) {
|
||||
test('visiting an alias', async function (assert) {
|
||||
await visit(urls.globalScope);
|
||||
await a11yAudit();
|
||||
|
||||
await click(`[href="${urls.aliases}"]`);
|
||||
await click(commonSelectors.HREF(urls.aliases));
|
||||
await a11yAudit();
|
||||
await click(`[href="${urls.alias}"]`);
|
||||
await click(commonSelectors.HREF(urls.alias));
|
||||
await a11yAudit();
|
||||
|
||||
assert.strictEqual(currentURL(), urls.alias);
|
||||
});
|
||||
|
||||
test('cannot navigate to a alias without proper authorization', async function (assert) {
|
||||
test('cannot navigate to an alias without proper authorization', async function (assert) {
|
||||
await visit(urls.globalScope);
|
||||
instances.alias.authorized_actions =
|
||||
instances.alias.authorized_actions.filter((item) => item !== 'read');
|
||||
|
||||
await click(`[href="${urls.aliases}"]`);
|
||||
await click(commonSelectors.HREF(urls.aliases));
|
||||
|
||||
assert.dom(TABLE_LINK_SELECTOR).doesNotExist();
|
||||
assert.dom(commonSelectors.TABLE_RESOURCE_LINK(urls.alias)).doesNotExist();
|
||||
});
|
||||
|
||||
test('visiting an unknown alias displays 404 message', async function (assert) {
|
||||
|
||||
Reference in new issue
Block a user