diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/frontend/set_status_modal | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) | |
download | gitlab-ce-a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4.tar.gz |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/frontend/set_status_modal')
-rw-r--r-- | spec/frontend/set_status_modal/set_status_modal_wrapper_spec.js | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/spec/frontend/set_status_modal/set_status_modal_wrapper_spec.js b/spec/frontend/set_status_modal/set_status_modal_wrapper_spec.js index 82fc06e1166..3ff6d1f9597 100644 --- a/spec/frontend/set_status_modal/set_status_modal_wrapper_spec.js +++ b/spec/frontend/set_status_modal/set_status_modal_wrapper_spec.js @@ -2,7 +2,8 @@ import { GlModal, GlFormCheckbox } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { initEmojiMock } from 'helpers/emoji'; import * as UserApi from '~/api/user_api'; -import { deprecatedCreateFlash as createFlash } from '~/flash'; +import EmojiPicker from '~/emoji/components/picker.vue'; +import createFlash from '~/flash'; import SetStatusModalWrapper, { AVAILABILITY_STATUS, } from '~/set_status_modal/set_status_modal_wrapper.vue'; @@ -25,7 +26,7 @@ describe('SetStatusModalWrapper', () => { defaultEmoji, }; - const createComponent = (props = {}) => { + const createComponent = (props = {}, improvedEmojiPicker = false) => { return shallowMount(SetStatusModalWrapper, { propsData: { ...defaultProps, @@ -34,6 +35,9 @@ describe('SetStatusModalWrapper', () => { mocks: { $toast, }, + provide: { + glFeatures: { improvedEmojiPicker }, + }, }); }; @@ -106,6 +110,20 @@ describe('SetStatusModalWrapper', () => { }); }); + describe('improvedEmojiPicker is true', () => { + beforeEach(async () => { + mockEmoji = await initEmojiMock(); + wrapper = createComponent({}, true); + return initModal(); + }); + + it('sets emojiTag when clicking in emoji picker', async () => { + await wrapper.findComponent(EmojiPicker).vm.$emit('click', 'thumbsup'); + + expect(wrapper.vm.emojiTag).toContain('data-name="thumbsup"'); + }); + }); + describe('with no currentMessage set', () => { beforeEach(async () => { mockEmoji = await initEmojiMock(); @@ -271,9 +289,9 @@ describe('SetStatusModalWrapper', () => { findModal().vm.$emit('ok'); await wrapper.vm.$nextTick(); - expect(createFlash).toHaveBeenCalledWith( - "Sorry, we weren't able to set your status. Please try again later.", - ); + expect(createFlash).toHaveBeenCalledWith({ + message: "Sorry, we weren't able to set your status. Please try again later.", + }); }); }); }); |