Files
threshold-ui/ui/admin/tests/acceptance/storage-buckets/read-test.js
T
lisbet-alvarez 94c3027392 test: 💍 acceptance tests for navigation link (#102)
* test: 💍 acceptance tests for navigation link

✅ Closes: ICU-8224
2023-03-08 08:42:20 -08:00

58 lines
1.6 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { module, test } from 'qunit';
import { visit, currentURL, click } from '@ember/test-helpers';
import { setupApplicationTest } from 'admin/tests/helpers';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import a11yAudit from 'ember-a11y-testing/test-support/audit';
import { authenticateSession } from 'ember-simple-auth/test-support';
module('Acceptance | storage-buckets | read', function (hooks) {
setupApplicationTest(hooks);
setupMirage(hooks);
let features;
const instances = {
scopes: {
global: null,
org: null,
},
};
const urls = {
globalScope: null,
storageBuckets: null,
};
hooks.beforeEach(function () {
instances.scopes.global = this.server.create('scope', { id: 'global' });
instances.scopes.org = this.server.create('scope', {
type: 'org',
scope: { id: 'global', type: 'global' },
});
instances.storageBucket = this.server.create('storage-bucket', {
scope: instances.scopes.global,
});
urls.globalScope = `/scopes/global`;
urls.storageBuckets = `${urls.globalScope}/storage-buckets`;
features = this.owner.lookup('service:features');
features.enable('session-recording');
authenticateSession({});
});
test('visiting storage buckets', async function (assert) {
assert.expect(1);
await visit(urls.globalScope);
await a11yAudit();
await click(`[href="${urls.storageBuckets}"]`);
assert.strictEqual(currentURL(), urls.storageBuckets);
});
});