Skip to content

Commit

Permalink
test auto close
Browse files Browse the repository at this point in the history
  • Loading branch information
amk221 committed Jan 17, 2025
1 parent 9889be0 commit 6ddcd24
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tests/integration/components/select-box/index/closing-test.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ module('select-box (closing)', function (hooks) {
assert.dom('.select-box__option[aria-current="true"]').doesNotExist();
});
test('closing due to clicking an option', async function (assert) {
test('closing due to clicking an option (trigger)', async function (assert) {
assert.expect(2);
await render(<template>
Expand All @@ -346,4 +346,30 @@ module('select-box (closing)', function (hooks) {
assert.verifySteps(['close SELECTED']);
});
test('closing due to clicking an option (input)', async function (assert) {
assert.expect(1);
await render(<template>
<SelectBox as |sb|>
<sb.Dropdown @open={{true}} @onClose={{handleClose}}>
<sb.Input />
<sb.Content>
<sb.Options>
<sb.Option />
</sb.Options>
</sb.Content>
</sb.Dropdown>
</SelectBox>
</template>);
await click('.select-box__input');
await click('.select-box__option');
assert.verifySteps(
[],
`does not make the assumption to close after making
a selection without the presence of a trigger`
);
});
});

0 comments on commit 6ddcd24

Please sign in to comment.