* fix: 🐛 properly show username for oidc auth method in user menu * test: 💍 fix admin ui tests * test: 💍 fix desktop ui tests * refactor: 💡 admin to not store username in authenticated object * refactor: 💡 use getter in app controller * test: 💍 POC for how we could update our tests to use auth account * refactor: 💡 remove unused service * test: 💍 fix all tests in ui/admin * test: 💍 revert one change * refactor: 💡 update ui/desktop w/ feedback + fix tests * refactor: 💡 add in error handling * refactor: 💡 cleanup unused service * test: 💍 fix e2e test selector ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-17231
50 lines
1.4 KiB
JavaScript
50 lines
1.4 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import {
|
|
setupApplicationTest as upstreamSetupApplicationTest,
|
|
setupRenderingTest as upstreamSetupRenderingTest,
|
|
setupTest as upstreamSetupTest,
|
|
} from 'ember-qunit';
|
|
import { authenticateSession } from 'ember-simple-auth/test-support';
|
|
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
|
|
|
// This file exists to provide wrappers around ember-qunit's
|
|
// test setup functions. This way, you can easily extend the setup that is
|
|
// needed per test type.
|
|
|
|
function setupApplicationTest(hooks, options) {
|
|
upstreamSetupApplicationTest(hooks, options);
|
|
|
|
// Additional setup for application tests can be done here.
|
|
|
|
setupMirage(hooks);
|
|
|
|
hooks.beforeEach(async function () {
|
|
this.server.create('scope', { id: 'global' }, 'withGlobalAuth');
|
|
const account_id = this.server.schema.accounts.first().id;
|
|
await authenticateSession({ isGlobal: true, account_id });
|
|
});
|
|
//
|
|
// This is also a good place to call test setup functions coming
|
|
// from other addons:
|
|
//
|
|
// setupIntl(hooks, 'en-us'); // ember-intl
|
|
}
|
|
|
|
function setupRenderingTest(hooks, options) {
|
|
upstreamSetupRenderingTest(hooks, options);
|
|
|
|
// Additional setup for rendering tests can be done here.
|
|
}
|
|
|
|
function setupTest(hooks, options) {
|
|
upstreamSetupTest(hooks, options);
|
|
|
|
// Additional setup for unit tests can be done here.
|
|
}
|
|
|
|
export { setupApplicationTest, setupRenderingTest, setupTest };
|