diff --git a/test-app/tests/integration/components/overlays/modal-test.ts b/test-app/tests/integration/components/overlays/modal-test.ts index 7b2ce884..7952eac1 100644 --- a/test-app/tests/integration/components/overlays/modal-test.ts +++ b/test-app/tests/integration/components/overlays/modal-test.ts @@ -5,7 +5,7 @@ import hbs from 'htmlbars-inline-precompile'; import { registerCustomStyles } from '@frontile/theme'; import { tv } from 'tailwind-variants'; -module('Integration | Component | @frontile/overlays/modal', function(hooks) { +module('Integration | Component | @frontile/overlays/modal', function (hooks) { setupRenderingTest(hooks); registerCustomStyles({ @@ -64,7 +64,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { `; - test('it renders, header, body, footer, and close-btn', async function(assert) { + test('it renders, header, body, footer, and close-btn', async function (assert) { this.set('isOpen', true); await render(template); @@ -75,7 +75,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"] .modal__close-btn').hasText('Close'); }); - test('it renders accessibility attributes', async function(assert) { + test('it renders accessibility attributes', async function (assert) { this.set('isOpen', true); await render(template); @@ -90,7 +90,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { .hasAttribute('id', ariaLablledBy); }); - test('it adds modifier class if @isCentered is set to true', async function(assert) { + test('it adds modifier class if @isCentered is set to true', async function (assert) { this.set('isOpen', true); this.set('isCentered', true); await render(template); @@ -98,7 +98,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"]').hasClass('modal--centered'); }); - test('it adds modifier class for size', async function(assert) { + test('it adds modifier class for size', async function (assert) { this.set('isOpen', true); await render(template); @@ -123,7 +123,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"]').hasClass('modal--full'); }); - test('it closes modal when close button is clicked', async function(assert) { + test('it closes modal when close button is clicked', async function (assert) { assert.expect(3); this.set('disableTransitions', true); @@ -141,7 +141,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"]').doesNotExist(); }); - test('it does not render close button when @allowCloseButton=false', async function(assert) { + test('it does not render close button when @allowCloseButton=false', async function (assert) { this.set('disableTransitions', true); this.set('isOpen', true); this.set('allowCloseButton', false); @@ -156,7 +156,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"] .modal__close-btn').doesNotExist(); }); - test('it closes modal when backdrop is clicked', async function(assert) { + test('it closes modal when backdrop is clicked', async function (assert) { assert.expect(3); this.set('disableTransitions', true); @@ -174,7 +174,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"]').doesNotExist(); }); - test('when @closeOnOutsideClick={{false}} does not close modal', async function(assert) { + test('when @closeOnOutsideClick={{false}} does not close modal', async function (assert) { assert.expect(1); this.set('closeOnOutsideClick', false); @@ -190,7 +190,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"]').exists(); }); - test('it closes modal when pressing Escape', async function(assert) { + test('it closes modal when pressing Escape', async function (assert) { assert.expect(2); this.set('isOpen', true); @@ -209,7 +209,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"]').doesNotExist(); }); - test('when @closeOnEscapeKey={{false}} does not close modal', async function(assert) { + test('when @closeOnEscapeKey={{false}} does not close modal', async function (assert) { assert.expect(1); this.set('closeOnEscapeKey', false); @@ -225,7 +225,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"]').exists(); }); - test('when @allowClosing={{false}} does not close modal', async function(assert) { + test('when @allowClosing={{false}} does not close modal', async function (assert) { assert.expect(4); this.set('allowClosing', false); @@ -248,7 +248,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"]').exists(); }); - test('when @renderInPlace={{true}} renders in place', async function(assert) { + test('when @renderInPlace={{true}} renders in place', async function (assert) { this.set('renderInPlace', true); this.set('isOpen', true); @@ -258,7 +258,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) { assert.dom('[data-test-id="modal"]', this.element).exists(); }); - test('it executes onOpen when modal is opened', async function(assert) { + test('it executes onOpen when modal is opened', async function (assert) { assert.expect(1); this.set('isOpen', true); this.set('onOpen', () => { diff --git a/test-app/tests/integration/components/overlays/overlay-test.ts b/test-app/tests/integration/components/overlays/overlay-test.ts index 08998e59..bf032610 100644 --- a/test-app/tests/integration/components/overlays/overlay-test.ts +++ b/test-app/tests/integration/components/overlays/overlay-test.ts @@ -13,7 +13,7 @@ import { tv } from 'tailwind-variants'; module( 'Integration | Component | @frontile/overlays/Overlay', - function(hooks) { + function (hooks) { setupRenderingTest(hooks); registerCustomStyles({ @@ -52,7 +52,7 @@ module( `; - test('it renders the content, into portal and only when opened', async function(assert) { + test('it renders the content, into portal and only when opened', async function (assert) { this.set('disableTransitions', true); this.set('isOpen', true); await render(template); @@ -71,7 +71,7 @@ module( assert.dom('[data-test-id="overlay"]').doesNotExist(); }); - test('when @renderInPlace={{true}} renders in place', async function(assert) { + test('when @renderInPlace={{true}} renders in place', async function (assert) { this.set('disableTransitions', true); this.set('renderInPlace', true); this.set('isOpen', true); @@ -85,7 +85,7 @@ module( assert.dom('[data-test-id="overlay"]').hasClass('overlay--in-place'); }); - test('when @backdrop=none does not render backdrop', async function(assert) { + test('when @backdrop=none does not render backdrop', async function (assert) { this.set('disableTransitions', true); this.set('isOpen', true); this.set('backdrop', 'none'); @@ -94,7 +94,7 @@ module( assert.dom('.overlay__backdrop').doesNotExist(); }); - test('it closes overlay when backdrop is clicked', async function(assert) { + test('it closes overlay when backdrop is clicked', async function (assert) { assert.expect(2); this.set('disableTransitions', true); @@ -110,7 +110,7 @@ module( assert.dom('[data-test-id="overlay"]').doesNotExist(); }); - test('when @closeOnOutsideClick={{false}} does not close overlay', async function(assert) { + test('when @closeOnOutsideClick={{false}} does not close overlay', async function (assert) { assert.expect(1); this.set('disableTransitions', true); @@ -127,7 +127,7 @@ module( assert.dom('[data-test-id="overlay"]').exists(); }); - test('it closes overlay when pressing Escape', async function(assert) { + test('it closes overlay when pressing Escape', async function (assert) { assert.expect(2); this.set('disableTransitions', true); @@ -147,7 +147,7 @@ module( assert.dom('[data-test-id="overlay"]').doesNotExist(); }); - test('when @closeOnEscapeKey={{false}} does not close overlay', async function(assert) { + test('when @closeOnEscapeKey={{false}} does not close overlay', async function (assert) { assert.expect(1); this.set('disableTransitions', true); @@ -164,7 +164,7 @@ module( assert.dom('[data-test-id="overlay"]').exists(); }); - test('it calles didClose when closed', async function(assert) { + test('it calles didClose when closed', async function (assert) { const calls: string[] = []; this.set('disableTransitions', true); @@ -184,7 +184,7 @@ module( assert.deepEqual(calls, ['onClose', 'didClose']); }); - test('it adds class to body to disable scroll', async function(assert) { + test('it adds class to body to disable scroll', async function (assert) { this.set('disableTransitions', true); this.set('isOpen', true); @@ -192,7 +192,7 @@ module( assert.dom(document.body).hasStyle({ overflow: 'hidden' }); }); - test('it does not add class to body when renderInPlace', async function(assert) { + test('it does not add class to body when renderInPlace', async function (assert) { this.set('isOpen', true); this.set('renderInPlace', true); this.set('disableTransitions', true); @@ -201,7 +201,7 @@ module( assert.dom(document.body).doesNotHaveStyle({ overflow: 'hidden' }); }); - test('it executes onOpen when overlay is opened', async function(assert) { + test('it executes onOpen when overlay is opened', async function (assert) { assert.expect(2); this.set('onOpen', () => { assert.ok(true); @@ -212,7 +212,7 @@ module( this.set('isOpen', true); }); - test('it manages focusing in content and restoration when focusTrap is disabled', async function(assert) { + test('it manages focusing in content and restoration when focusTrap is disabled', async function (assert) { this.set('disableTransitions', true); this.set('disableFocusTrap', true); this.set('isOpen', false); diff --git a/test-app/tests/integration/components/overlays/popover-test.ts b/test-app/tests/integration/components/overlays/popover-test.ts index 8efa265b..96a159c0 100644 --- a/test-app/tests/integration/components/overlays/popover-test.ts +++ b/test-app/tests/integration/components/overlays/popover-test.ts @@ -7,7 +7,7 @@ import { tv } from 'tailwind-variants'; module( 'Integration | Component | Popover | @frontile/overlays', - function(hooks) { + function (hooks) { setupRenderingTest(hooks); registerCustomStyles({ @@ -22,7 +22,7 @@ module( }) as never }); - test('it works with trigger and opening content', async function(assert) { + test('it works with trigger and opening content', async function (assert) { await render( hbs` @@ -52,7 +52,7 @@ module( ); }); - test('it works with trigger hover mode, prevents focus restore', async function(assert) { + test('it works with trigger hover mode, prevents focus restore', async function (assert) { await render( hbs` @@ -95,7 +95,7 @@ module( ); }); - test('it renders accessibility attributes', async function(assert) { + test('it renders accessibility attributes', async function (assert) { await render( hbs` @@ -121,7 +121,7 @@ module( assert.dom('[data-test-id="content"]').hasAttribute('id'); }); - test('it shows backdrop when @backdrop=none', async function(assert) { + test('it shows backdrop when @backdrop=none', async function (assert) { this.set('backdrop', 'none'); await render( @@ -150,7 +150,7 @@ module( assert.dom('.overlay__backdrop').exists(); }); - test('clicking outside closes menu', async function(assert) { + test('clicking outside closes menu', async function (assert) { let calledClosed = false; this.set('didClose', () => { calledClosed = true; @@ -190,7 +190,7 @@ module( ); }); - test('controlled isOpen', async function(assert) { + test('controlled isOpen', async function (assert) { let isOpen = false; this.set('isOpen', false); this.set('onOpenChange', (value: boolean) => { @@ -232,7 +232,7 @@ module( assert.dom('[data-test-id="content"]').doesNotExist(); }); - test('it prevents trigger event bubbling', async function(assert) { + test('it prevents trigger event bubbling', async function (assert) { assert.expect(1); this.set('parentClick', () => {