diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/frontend/notes/components/note_header_spec.js | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/frontend/notes/components/note_header_spec.js')
-rw-r--r-- | spec/frontend/notes/components/note_header_spec.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/frontend/notes/components/note_header_spec.js b/spec/frontend/notes/components/note_header_spec.js index 2bb08b60569..69aab0d051e 100644 --- a/spec/frontend/notes/components/note_header_spec.js +++ b/spec/frontend/notes/components/note_header_spec.js @@ -1,7 +1,9 @@ import { shallowMount, createLocalVue } from '@vue/test-utils'; import { nextTick } from 'vue'; import Vuex from 'vuex'; +import { GlSprintf } from '@gitlab/ui'; import NoteHeader from '~/notes/components/note_header.vue'; +import { AVAILABILITY_STATUS } from '~/set_status_modal/utils'; const localVue = createLocalVue(); localVue.use(Vuex); @@ -28,6 +30,9 @@ describe('NoteHeader component', () => { path: '/root', state: 'active', username: 'root', + status: { + availability: '', + }, }; const createComponent = props => { @@ -37,6 +42,7 @@ describe('NoteHeader component', () => { actions, }), propsData: { ...props }, + stubs: { GlSprintf }, }); }; @@ -78,7 +84,7 @@ describe('NoteHeader component', () => { expanded: true, }); - expect(findChevronIcon().classes()).toContain('fa-chevron-up'); + expect(findChevronIcon().props('name')).toBe('chevron-up'); }); it('has chevron-down icon if expanded prop is false', () => { @@ -87,7 +93,7 @@ describe('NoteHeader component', () => { expanded: false, }); - expect(findChevronIcon().classes()).toContain('fa-chevron-down'); + expect(findChevronIcon().props('name')).toBe('chevron-down'); }); }); @@ -97,6 +103,12 @@ describe('NoteHeader component', () => { expect(wrapper.find('.js-user-link').exists()).toBe(true); }); + it('renders busy status if author availability is set', () => { + createComponent({ author: { ...author, status: { availability: AVAILABILITY_STATUS.BUSY } } }); + + expect(wrapper.find('.js-user-link').text()).toContain('(Busy)'); + }); + it('renders deleted user text if author is not passed as a prop', () => { createComponent(); |