event name

This commit is contained in:
Henry Jameson 2026-06-30 23:56:17 +03:00
commit 0c8759ad7d
2 changed files with 5 additions and 5 deletions

View file

@ -16,7 +16,7 @@
:params="params" :params="params"
@posted="doCloseModal" @posted="doCloseModal"
@draft-done="doCloseModal" @draft-done="doCloseModal"
@can-close="doCloseModal" @close-accepted="doCloseModal"
/> />
</div> </div>
</Modal> </Modal>

View file

@ -100,7 +100,7 @@ describe('Draft saving', () => {
await textarea.setValue('mew mew') await textarea.setValue('mew mew')
wrapper.vm.requestClose() wrapper.vm.requestClose()
expect(wrapper.vm.$store.getters.draftCount).to.equal(1) expect(wrapper.vm.$store.getters.draftCount).to.equal(1)
await waitForEvent(wrapper, 'can-close') await waitForEvent(wrapper, 'close-accepted')
}) })
it('should save when close if auto-save is off, and unsavedPostAction is save', async () => { it('should save when close if auto-save is off, and unsavedPostAction is save', async () => {
@ -122,7 +122,7 @@ describe('Draft saving', () => {
await textarea.setValue('mew mew') await textarea.setValue('mew mew')
wrapper.vm.requestClose() wrapper.vm.requestClose()
expect(wrapper.vm.$store.getters.draftCount).to.equal(1) expect(wrapper.vm.$store.getters.draftCount).to.equal(1)
await waitForEvent(wrapper, 'can-close') await waitForEvent(wrapper, 'close-accepted')
}) })
it('should discard when close if auto-save is off, and unsavedPostAction is discard', async () => { it('should discard when close if auto-save is off, and unsavedPostAction is discard', async () => {
@ -143,7 +143,7 @@ describe('Draft saving', () => {
const textarea = wrapper.get('textarea') const textarea = wrapper.get('textarea')
await textarea.setValue('mew mew') await textarea.setValue('mew mew')
wrapper.vm.requestClose() wrapper.vm.requestClose()
await waitForEvent(wrapper, 'can-close') await waitForEvent(wrapper, 'close-accepted')
expect(wrapper.vm.$store.getters.draftCount).to.equal(0) expect(wrapper.vm.$store.getters.draftCount).to.equal(0)
}) })
@ -180,6 +180,6 @@ describe('Draft saving', () => {
console.info('clicked') console.info('clicked')
expect(wrapper.vm.$store.getters.draftCount).to.equal(1) expect(wrapper.vm.$store.getters.draftCount).to.equal(1)
await flushPromises() await flushPromises()
await waitForEvent(wrapper, 'can-close') await waitForEvent(wrapper, 'close-accepted')
}) })
}) })