Skip to content

Commit

Permalink
chore: more lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarluedke committed Nov 5, 2024
1 parent a6c63e0 commit 7babbb6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
28 changes: 14 additions & 14 deletions test-app/tests/integration/components/overlays/modal-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -64,7 +64,7 @@ module('Integration | Component | @frontile/overlays/modal', function(hooks) {
</Modal>
`;

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);

Expand All @@ -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);

Expand All @@ -90,15 +90,15 @@ 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);

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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -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', () => {
Expand Down
26 changes: 13 additions & 13 deletions test-app/tests/integration/components/overlays/overlay-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { tv } from 'tailwind-variants';

module(
'Integration | Component | @frontile/overlays/Overlay',
function(hooks) {
function (hooks) {
setupRenderingTest(hooks);

registerCustomStyles({
Expand Down Expand Up @@ -52,7 +52,7 @@ module(
</Overlay>
`;

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);
Expand All @@ -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);
Expand All @@ -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');
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -184,15 +184,15 @@ 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);

await render(template);
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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions test-app/tests/integration/components/overlays/popover-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { tv } from 'tailwind-variants';

module(
'Integration | Component | Popover | @frontile/overlays',
function(hooks) {
function (hooks) {
setupRenderingTest(hooks);

registerCustomStyles({
Expand All @@ -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`
<Popover as |p|>
Expand Down Expand Up @@ -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`
<button type="button" data-test-id="focused-element">Button</button>
Expand Down Expand Up @@ -95,7 +95,7 @@ module(
);
});

test('it renders accessibility attributes', async function(assert) {
test('it renders accessibility attributes', async function (assert) {
await render(
hbs`
<Popover as |p|>
Expand All @@ -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(
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit 7babbb6

Please sign in to comment.