mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Render modals in a closed state and hide
I found out that when you umount the modals completely you don't get the nice hide effect of `<ds-modal>`. It should be safe to still have all modals in the DOM.
This commit is contained in:
parent
0b9ad5c395
commit
b7ca8a426b
@ -54,9 +54,9 @@ describe('Modal.vue', () => {
|
||||
describe('shallowMount', () => {
|
||||
const Wrapper = createWrapper(shallowMount)
|
||||
|
||||
it('renders nothing', () => {
|
||||
it('renders all modals as closed', () => {
|
||||
wrapper = Wrapper()
|
||||
expect(wrapper.isEmpty()).toBe(true)
|
||||
expect(wrapper.find(DisableModal).vm.isOpen).toBe(false)
|
||||
})
|
||||
|
||||
describe('store/modal holds data to disable', () => {
|
||||
@ -84,10 +84,10 @@ describe('Modal.vue', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('click cancel', () => {
|
||||
it('empties wrapper', () => {
|
||||
describe('child component emits close', () => {
|
||||
it('close DisableModal', () => {
|
||||
wrapper.find(DisableModal).vm.$emit('close')
|
||||
expect(wrapper.isEmpty()).toBe(true)
|
||||
expect(wrapper.find(DisableModal).vm.isOpen).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<div class="modal-wrapper">
|
||||
<disable-modal
|
||||
v-if="open === 'disable'"
|
||||
:is-open="open === 'disable'"
|
||||
:resource="data"
|
||||
@close="close"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user