Files
threshold-ui/ui/admin/tests/helpers/index.js
T
Lisbet Alvarez 3ba93927fe Update copyright headers (#3146)
* empty commit

* Add missing copyright headers

* chore: 🤖 update copywrite config file with correct year

* Add missing copyright headers

* empty commit (gh action merge checks are stuck)
2026-01-28 17:09:06 -08:00

50 lines
1.4 KiB
JavaScript

/**
* Copyright IBM Corp. 2021, 2026
* 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 };