diff options
Diffstat (limited to 'spec/frontend/notifications')
-rw-r--r-- | spec/frontend/notifications/components/custom_notifications_modal_spec.js | 14 | ||||
-rw-r--r-- | spec/frontend/notifications/components/notifications_dropdown_spec.js | 11 |
2 files changed, 13 insertions, 12 deletions
diff --git a/spec/frontend/notifications/components/custom_notifications_modal_spec.js b/spec/frontend/notifications/components/custom_notifications_modal_spec.js index c5d201c3aec..cd04adac72d 100644 --- a/spec/frontend/notifications/components/custom_notifications_modal_spec.js +++ b/spec/frontend/notifications/components/custom_notifications_modal_spec.js @@ -56,8 +56,8 @@ describe('CustomNotificationsModal', () => { ); } - const findModalBodyDescription = () => wrapper.find(GlSprintf); - const findAllCheckboxes = () => wrapper.findAll(GlFormCheckbox); + const findModalBodyDescription = () => wrapper.findComponent(GlSprintf); + const findAllCheckboxes = () => wrapper.findAllComponents(GlFormCheckbox); const findCheckboxAt = (index) => findAllCheckboxes().at(index); beforeEach(() => { @@ -111,7 +111,7 @@ describe('CustomNotificationsModal', () => { const checkbox = findCheckboxAt(index); expect(checkbox.text()).toContain(eventName); expect(checkbox.vm.$attrs.checked).toBe(enabled); - expect(checkbox.find(GlLoadingIcon).exists()).toBe(loading); + expect(checkbox.findComponent(GlLoadingIcon).exists()).toBe(loading); }, ); }); @@ -142,7 +142,7 @@ describe('CustomNotificationsModal', () => { wrapper = createComponent({ injectedProperties }); - wrapper.find(GlModal).vm.$emit('show'); + wrapper.findComponent(GlModal).vm.$emit('show'); await waitForPromises(); @@ -159,7 +159,7 @@ describe('CustomNotificationsModal', () => { wrapper = createComponent(); - wrapper.find(GlModal).vm.$emit('show'); + wrapper.findComponent(GlModal).vm.$emit('show'); expect(wrapper.vm.isLoading).toBe(true); await waitForPromises(); @@ -176,7 +176,7 @@ describe('CustomNotificationsModal', () => { mockAxios.onGet('/api/v4/notification_settings').reply(httpStatus.NOT_FOUND, {}); wrapper = createComponent(); - wrapper.find(GlModal).vm.$emit('show'); + wrapper.findComponent(GlModal).vm.$emit('show'); await waitForPromises(); @@ -197,7 +197,7 @@ describe('CustomNotificationsModal', () => { ${null} | ${1} | ${'/api/v4/groups/1/notification_settings'} | ${'group'} | ${'a groupId is given'} ${null} | ${null} | ${'/api/v4/notification_settings'} | ${'global'} | ${'neither projectId nor groupId are given'} `( - 'updates the $notificationType notification settings when $condition and the user clicks the checkbox ', + 'updates the $notificationType notification settings when $condition and the user clicks the checkbox', async ({ projectId, groupId, endpointUrl }) => { mockAxios .onGet(endpointUrl) diff --git a/spec/frontend/notifications/components/notifications_dropdown_spec.js b/spec/frontend/notifications/components/notifications_dropdown_spec.js index 7ca6c2052ae..7a98b374095 100644 --- a/spec/frontend/notifications/components/notifications_dropdown_spec.js +++ b/spec/frontend/notifications/components/notifications_dropdown_spec.js @@ -40,12 +40,13 @@ describe('NotificationsDropdown', () => { }); } - const findDropdown = () => wrapper.find(GlDropdown); + const findDropdown = () => wrapper.findComponent(GlDropdown); const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`); - const findAllNotificationsDropdownItems = () => wrapper.findAll(NotificationsDropdownItem); + const findAllNotificationsDropdownItems = () => + wrapper.findAllComponents(NotificationsDropdownItem); const findDropdownItemAt = (index) => - findAllNotificationsDropdownItems().at(index).find(GlDropdownItem); - const findNotificationsModal = () => wrapper.find(CustomNotificationsModal); + findAllNotificationsDropdownItems().at(index).findComponent(GlDropdownItem); + const findNotificationsModal = () => wrapper.findComponent(CustomNotificationsModal); const clickDropdownItemAt = async (index) => { const dropdownItem = findDropdownItemAt(index); @@ -243,7 +244,7 @@ describe('NotificationsDropdown', () => { expect(dropdownItem.props('isChecked')).toBe(true); }); - it("won't update the selectedNotificationLevel and shows a toast message when the request fails and ", async () => { + it("won't update the selectedNotificationLevel and shows a toast message when the request fails and", async () => { mockAxios.onPut('/api/v4/notification_settings').reply(httpStatus.NOT_FOUND, {}); wrapper = createComponent(); |