From 9f54d25ad1ecaccf2a63ce195a05e5c0578d8c86 Mon Sep 17 00:00:00 2001 From: Jana Kocakova Date: Mon, 15 Dec 2025 23:42:36 +0100 Subject: [PATCH 1/9] =?UTF-8?q?Migrate=20SavedSearchesModal=20dialogs=20to?= =?UTF-8?q?=20KDS=20=E2=80=94=20fixes=20#?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ImportFromChannels/SavedSearchesModal.vue | 154 ++++++++++-------- 1 file changed, 90 insertions(+), 64 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SavedSearchesModal.vue b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SavedSearchesModal.vue index 8d494e8899..0304a32384 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SavedSearchesModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SavedSearchesModal.vue @@ -13,72 +13,58 @@ />

{{ $tr('noSavedSearches') }}

- - - + - - - +

{{ $tr('deleteConfirmation') }}

+ @@ -87,14 +73,12 @@ - - - diff --git a/contentcuration/contentcuration/frontend/administration/components/__tests__/confirmationDialog.spec.js b/contentcuration/contentcuration/frontend/administration/components/__tests__/confirmationDialog.spec.js deleted file mode 100644 index 1fa1616c03..0000000000 --- a/contentcuration/contentcuration/frontend/administration/components/__tests__/confirmationDialog.spec.js +++ /dev/null @@ -1,27 +0,0 @@ -import { mount } from '@vue/test-utils'; -import ConfirmationDialog from '../ConfirmationDialog.vue'; - -function makeWrapper() { - return mount(ConfirmationDialog, { - propsData: { - title: 'title', - text: 'text', - confirmButtonText: 'confirm', - }, - }); -} - -describe('confirmationDialog', () => { - let wrapper; - beforeEach(() => { - wrapper = makeWrapper(); - }); - it('should emit input with false value on close', () => { - wrapper.find('[data-test="close"]').trigger('click'); - expect(wrapper.emitted('input')[0][0]).toBe(false); - }); - it('should emit confirm event when confirm button is clicked', () => { - wrapper.find('[data-test="confirm"]').trigger('click'); - expect(wrapper.emitted('confirm')).toHaveLength(1); - }); -}); diff --git a/contentcuration/contentcuration/frontend/shared/views/MessageDialog.vue b/contentcuration/contentcuration/frontend/shared/views/MessageDialog.vue deleted file mode 100644 index 833e9a6022..0000000000 --- a/contentcuration/contentcuration/frontend/shared/views/MessageDialog.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - diff --git a/contentcuration/contentcuration/frontend/shared/views/__tests__/messageDialog.spec.js b/contentcuration/contentcuration/frontend/shared/views/__tests__/messageDialog.spec.js deleted file mode 100644 index e86a1b2c1b..0000000000 --- a/contentcuration/contentcuration/frontend/shared/views/__tests__/messageDialog.spec.js +++ /dev/null @@ -1,34 +0,0 @@ -import { mount } from '@vue/test-utils'; -import MessageDialog from '../MessageDialog'; - -function makeWrapper(options) { - return mount(MessageDialog, { - propsData: { - header: 'header', - text: 'text', - }, - ...options, - }); -} - -describe('messageDialog', () => { - it('header and text should render properly from props', () => { - const wrapper = makeWrapper(); - expect(wrapper.find('[data-test="text"]').text()).toEqual('text'); - }); - it('slots should render content correctly', () => { - const wrapper = makeWrapper({ - slots: { - default: ['new text'], - buttons: ['buttons'], - }, - }); - expect(wrapper.find('[data-test="text"]').text()).toContain('new text'); - expect(wrapper.find('[data-test="buttons"]').text()).toContain('buttons'); - }); - it('close should emit an input event to close the modal', () => { - const wrapper = makeWrapper(); - wrapper.vm.close(); - expect(wrapper.emitted('input')[0][0]).toBe(false); - }); -});