Skip to content

Commit fd986c5

Browse files
committed
adding additional test
1 parent c4e5853 commit fd986c5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

showcase/tests/integration/components/hds/modal/index-test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,18 @@ module('Integration | Component | hds/modal/index', function (hooks) {
143143
await click('#cancel-button');
144144
assert.dom('#test-modal').isNotVisible();
145145
});
146+
test('it should close the modal when the "close" function is called from within the body', async function (assert) {
147+
await render(
148+
hbs`<Hds::Modal id="test-modal" as |M|>
149+
<M.Body as |B|>
150+
<Hds::Button id="body-close-button" type="button" @text="Close from Body" @color="secondary" {{on "click" B.close}} />
151+
</M.Body>
152+
</Hds::Modal>`,
153+
);
154+
assert.dom('#test-modal').isVisible();
155+
await click('#body-close-button');
156+
assert.dom('#test-modal').isNotVisible();
157+
});
146158
test('it should close the modal when the "esc" key is pressed', async function (assert) {
147159
await render(
148160
hbs`<Hds::Modal id="test-modal" as |M|><M.Header>Title</M.Header></Hds::Modal>`,

0 commit comments

Comments
 (0)