Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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.js30
1 files changed, 28 insertions, 2 deletions
diff --git a/spec/frontend/notes/components/note_header_spec.js b/spec/frontend/notes/components/note_header_spec.js
index 43fbc5e26dc..76177229cff 100644
--- a/spec/frontend/notes/components/note_header_spec.js
+++ b/spec/frontend/notes/components/note_header_spec.js
@@ -3,7 +3,7 @@ import Vue, { nextTick } from 'vue';
import Vuex from 'vuex';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import NoteHeader from '~/notes/components/note_header.vue';
-import { AVAILABILITY_STATUS } from '~/set_status_modal/utils';
+import { AVAILABILITY_STATUS } from '~/set_status_modal/constants';
import UserNameWithStatus from '~/sidebar/components/assignees/user_name_with_status.vue';
Vue.use(Vuex);
@@ -40,13 +40,19 @@ describe('NoteHeader component', () => {
availability: '',
};
- const createComponent = (props) => {
+ const createComponent = (props, userAttributes = false) => {
wrapper = shallowMountExtended(NoteHeader, {
store: new Vuex.Store({
actions,
}),
propsData: { ...props },
stubs: { GlSprintf, UserNameWithStatus },
+ provide: {
+ glFeatures: {
+ removeUserAttributesProjects: userAttributes,
+ removeUserAttributesGroups: userAttributes,
+ },
+ },
});
};
@@ -55,6 +61,26 @@ describe('NoteHeader component', () => {
wrapper = null;
});
+ describe('when removeUserAttributesProjects feature flag is enabled', () => {
+ it('does not render busy status', () => {
+ createComponent({ author: { ...author, availability: AVAILABILITY_STATUS.BUSY } }, true);
+
+ expect(wrapper.find('.note-header-info').text()).not.toContain('(Busy)');
+ });
+
+ it('does not render author status', () => {
+ createComponent({ author }, true);
+
+ expect(findAuthorStatus().exists()).toBe(false);
+ });
+
+ it('does not render username', () => {
+ createComponent({ author }, true);
+
+ expect(wrapper.find('.note-header-info').text()).not.toContain('@');
+ });
+ });
+
it('does not render discussion actions when includeToggle is false', () => {
createComponent({
includeToggle: false,