summaryrefslogtreecommitdiff
path: root/spec/frontend/notes/components/note_header_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/notes/components/note_header_spec.js')
-rw-r--r--spec/frontend/notes/components/note_header_spec.js16
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();