Commit e908ab6e authored by Jay Swain's avatar Jay Swain

Clicking backdrop closes modal for What's New

Clicking the grey backdrop closes the modal for the What's New modal.

part of:
https://gitlab.com/gitlab-org/growth/engineering/-/issues/5434
parent c65eb7dc
......@@ -88,6 +88,6 @@ export default {
<skeleton-loader />
</div>
</gl-drawer>
<div v-if="open" class="whats-new-modal-backdrop modal-backdrop"></div>
<div v-if="open" class="whats-new-modal-backdrop modal-backdrop" @click="closeDrawer"></div>
</div>
</template>
---
title: clicking backdrop closes modal for What's New
merge_request: 61420
author:
type: changed
......@@ -82,6 +82,7 @@ describe('App', () => {
});
const getDrawer = () => wrapper.find(GlDrawer);
const getBackdrop = () => wrapper.find('.whats-new-modal-backdrop');
it('contains a drawer', () => {
expect(getDrawer().exists()).toBe(true);
......@@ -100,6 +101,11 @@ describe('App', () => {
expect(actions.closeDrawer).toHaveBeenCalled();
});
it('dispatches closeDrawer when clicking the backdrop', () => {
getBackdrop().trigger('click');
expect(actions.closeDrawer).toHaveBeenCalled();
});
it.each([true, false])('passes open property', async (openState) => {
wrapper.vm.$store.state.open = openState;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment