Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Dharini <dharini@hashicorp.com>
50 lines
1.4 KiB
JavaScript
50 lines
1.4 KiB
JavaScript
/**
|
|
* Copyright IBM Corp. 2021, 2025
|
|
* 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 };
|