Files
threshold-ui/ui/admin/tests/acceptance/credential-stores-test.js
T
Carlos Alcaide 75f45a134d feat: 🎸 Add more features to the credential stores list
Add breadcrumb functionality. Add detail route. Add acceptance test to
load the page. Add some styling improvements

✅ Closes: \
2021-07-12 07:32:35 -07:00

49 lines
1.5 KiB
JavaScript

import { module, test } from 'qunit';
import { visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import a11yAudit from 'ember-a11y-testing/test-support/audit';
module('Acceptance | credential-stores', function (hooks) {
setupApplicationTest(hooks);
setupMirage(hooks);
const instances = {
scopes: {
global: null,
org: null,
project: null,
},
};
const urls = {
globalScope: null,
credentialStores: null,
};
hooks.beforeEach(function () {
// Generate resources
instances.scopes.global = this.server.create('scope', { id: 'global' });
instances.scopes.org = this.server.create('scope', {
type: 'org',
scope: { id: 'global', type: 'global' },
});
instances.scopes.project = this.server.create('scope', {
type: 'project',
scope: { id: instances.scopes.org.id, type: 'org' },
});
// Generate route URLs for resources
urls.globalScope = `/scopes/global/scopes`;
urls.orgScope = `/scopes/${instances.scopes.org.id}/scopes`;
urls.projectScope = `/scopes/${instances.scopes.project.id}`;
urls.credentialStores = `${urls.projectScope}/credential-stores`;
});
test('visiting /credential-stores', async function (assert) {
assert.expect(1);
await visit(urls.credentialStores);
await a11yAudit();
assert.equal(currentURL(), urls.credentialStores);
});
});