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_body_spec.js')
-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..0f765a8da87 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 { INTERNAL_NOTE_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 internal note classes', () => {
+ expect(wrapper.findByTestId('note-internal-container').classes()).not.toEqual(
+ INTERNAL_NOTE_CLASSES,
+ );
+ });
+
+ describe('isInternalNote', () => {
+ beforeEach(() => {
+ wrapper = createComponent({ props: { isInternalNote: true } });
+ });
+
+ it('should have internal note classes', () => {
+ expect(wrapper.findByTestId('note-internal-container').classes()).toEqual(
+ INTERNAL_NOTE_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('isInternalNote', () => {
+ beforeEach(() => {
+ wrapper.setProps({ isInternalNote: true });
+ });
+
+ it('should not have internal note classes', () => {
+ expect(wrapper.findByTestId('note-internal-container').classes()).not.toEqual(
+ INTERNAL_NOTE_CLASSES,
+ );
+ });
+ });
});
describe('commitMessage', () => {