Files

29 lines
1.1 KiB
Plaintext

import { module, test } from 'qunit';
import { setupRenderingTest } from 'dashtab/tests/helpers';
import { render, click } from '@ember/test-helpers';
import SettingsButton from 'dashtab/components/settings-button';
import ModalHost from 'dashtab/components/modal-host';
import GlobalSettings from 'dashtab/components/settings/global-settings';
module('Integration | Component | settings-button', function (hooks) {
setupRenderingTest(hooks);
test('opens the global settings dialog', async function (assert) {
const modal = this.owner.lookup('service:modal');
await render(<template><SettingsButton /></template>);
await click('[aria-label="Open settings"]');
assert.strictEqual(modal.current.component, GlobalSettings);
assert.strictEqual(modal.current.size, 'settings');
});
test('opens at the settings panel width', async function (assert) {
await render(<template><SettingsButton /><ModalHost /></template>);
await click('[aria-label="Open settings"]');
assert.dom('el-dialog-panel').hasClass('sm:max-w-4xl');
assert.dom('el-dialog-panel h3').hasText('Photos');
});
});