Files
threshold-ui/ui/admin/tests/acceptance/develop-test.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

43 lines
1.2 KiB
JavaScript

/**
* Copyright IBM Corp. 2021, 2026
* SPDX-License-Identifier: BUSL-1.1
*/
import { module, test } from 'qunit';
import { visit, getContext } from '@ember/test-helpers';
import { setupApplicationTest } from 'admin/tests/helpers';
import { setupSqlite } from 'api/test-support/helpers/sqlite';
module('Acceptance | develop', function (hooks) {
setupApplicationTest(hooks);
setupSqlite(hooks);
let featuresService;
const DEV_TOGGLE_SELECTOR = '[data-test-dev-edition-toggle]';
hooks.beforeEach(async function () {
const { owner } = getContext();
featuresService = owner.lookup('service:features');
this.server.create('scope', {
type: 'org',
scope: { id: 'global', type: 'global' },
});
});
test('edition toggle is hidden when `dev-edition-toggle` is false', async function (assert) {
await visit('/');
assert.false(featuresService.isEnabled('dev-edition-toggle'));
assert.dom(DEV_TOGGLE_SELECTOR).doesNotExist();
});
test('edition toggle is visible when `dev-edition-toggle` is true', async function (assert) {
assert.false(featuresService.isEnabled('dev-edition-toggle'));
featuresService.enable('dev-edition-toggle');
await visit('/');
assert.dom(DEV_TOGGLE_SELECTOR).isVisible();
});
});