Skip to content

Commit

Permalink
✅ update dialog test - composition with transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
far-fetched committed Nov 3, 2021
1 parent ac7f8e3 commit 8075394
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 8075394

Please sign in to comment.