Skip to content

Commit

Permalink
Merge pull request #109 from far-fetched/update-dialog-test-compositi…
Browse files Browse the repository at this point in the history
…on-with-transitions

✅ update dialog test - composition with transitions
  • Loading branch information
GavinJoyce authored Nov 4, 2021
2 parents ac7f8e3 + 8075394 commit 1d1018f
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions tests/integration/components/dialog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,39 @@ module('Integration | Component | <Dialog>', function (hooks) {
});

module('Composition', function () {
todo(
'it should be possible to open the Dialog via a Transition component',
async function () {}
);
test('it should be possible to open the Dialog via a Transition component', async function () {
this.set('noop', function () {});

todo(
'it should be possible to close the Dialog via a Transition component',
async function () {}
);
await render(hbs`
<Transition @show={{true}}>
<Dialog @isOpen={{true}} @onClose={{this.noop}} as |d|>
<d.Description>Hello</d.Description>
<div tabindex="0"></div>
</Dialog>
</Transition>
`);

assertDialog({ state: DialogState.Visible });
assertDialogDescription({
state: DialogState.Visible,
textContent: 'Hello',
});
});

test('it should be possible to close the Dialog via a Transition component', async function () {
this.set('noop', function () {});

await render(hbs`
<Transition @show={{false}}>
<Dialog @isOpen={{true}} @onClose={{this.noop}} as |d|>
<d.Description>Hello</d.Description>
<div tabindex="0"></div>
</Dialog>
</Transition>
`);

assertDialog({ state: DialogState.InvisibleUnmounted });
});
});

module('Keyboard interactions', function () {
Expand Down

0 comments on commit 1d1018f

Please sign in to comment.