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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-24 15:09:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-24 15:09:04 +0300
commit4b4c254b2cfaca26c2c8e2bda70d45c13e3a6f97 (patch)
treef30595f3879d12d6be5b75ac25bb0ad566153293 /spec/frontend/notes/components
parent43c14d2d9245aea5964d52d3e4915be1126977cb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes/components')
-rw-r--r--spec/frontend/notes/components/note_body_spec.js35
1 files changed, 33 insertions, 2 deletions
diff --git a/spec/frontend/notes/components/note_body_spec.js b/spec/frontend/notes/components/note_body_spec.js
index 378dcb97fab..0481dd12c68 100644
--- a/spec/frontend/notes/components/note_body_spec.js
+++ b/spec/frontend/notes/components/note_body_spec.js
@@ -1,5 +1,5 @@
-import { shallowMount } from '@vue/test-utils';
import Vuex from 'vuex';
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import { suggestionCommitMessage } from '~/diffs/store/getters';
import NoteBody from '~/notes/components/note_body.vue';
@@ -7,6 +7,7 @@ import NoteAwardsList from '~/notes/components/note_awards_list.vue';
import NoteForm from '~/notes/components/note_form.vue';
import createStore from '~/notes/stores';
import notes from '~/notes/stores/modules/index';
+import { CONFIDENTIAL_CLASSES } from '~/notes/constants';
import Suggestions from '~/vue_shared/components/markdown/suggestions.vue';
@@ -27,7 +28,7 @@ const createComponent = ({
mockStore.dispatch('setNotesData', notesData);
}
- return shallowMount(NoteBody, {
+ return shallowMountExtended(NoteBody, {
store: mockStore || store,
propsData: {
note,
@@ -58,6 +59,24 @@ describe('issue_note_body component', () => {
expect(wrapper.findComponent(NoteAwardsList).exists()).toBe(true);
});
+ it('should not have confidential classes', () => {
+ expect(wrapper.findByTestId('note-confidential-container').classes()).not.toEqual(
+ CONFIDENTIAL_CLASSES,
+ );
+ });
+
+ describe('isConfidential', () => {
+ beforeEach(() => {
+ wrapper = createComponent({ props: { isConfidential: true } });
+ });
+
+ it('should have confidential classes', () => {
+ expect(wrapper.findByTestId('note-confidential-container').classes()).toEqual(
+ CONFIDENTIAL_CLASSES,
+ );
+ });
+ });
+
describe('isEditing', () => {
beforeEach(() => {
wrapper = createComponent({ props: { isEditing: true } });
@@ -86,6 +105,18 @@ describe('issue_note_body component', () => {
// which is defined in `app/assets/javascripts/notes/mixins/autosave.js`
expect(wrapper.vm.autosave.key).toEqual(autosaveKey);
});
+
+ describe('isConfidential', () => {
+ beforeEach(() => {
+ wrapper.setProps({ isConfidential: true });
+ });
+
+ it('should not have confidential classes', () => {
+ expect(wrapper.findByTestId('note-confidential-container').classes()).not.toEqual(
+ CONFIDENTIAL_CLASSES,
+ );
+ });
+ });
});
describe('commitMessage', () => {