summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2019-03-27 14:37:17 +0000
committerFatih Acet <acetfatih@gmail.com>2019-03-27 14:37:17 +0000
commit6a905e8e585b666bb5c8c7fe9c1ae6a0bf3c67bd (patch)
treeeeb7110ecfe7edd91581e5c791e62bc1352a643f
parent6fce4a49d53963ad68b6dcb09d04b8c2488ffb7b (diff)
parent4d1ac5651870d110a8e61657730a594bf3f179fc (diff)
downloadgitlab-ce-6a905e8e585b666bb5c8c7fe9c1ae6a0bf3c67bd.tar.gz
Merge branch 'winh-cleanup-note_form_spec' into 'master'
Remove top-level mount from note_form_spec.js Closes #59114 See merge request gitlab-org/gitlab-ce!26616
-rw-r--r--spec/javascripts/notes/components/note_form_spec.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/spec/javascripts/notes/components/note_form_spec.js b/spec/javascripts/notes/components/note_form_spec.js
index c48f8188105..b632ee6736d 100644
--- a/spec/javascripts/notes/components/note_form_spec.js
+++ b/spec/javascripts/notes/components/note_form_spec.js
@@ -41,8 +41,6 @@ describe('issue_note_form component', () => {
noteBody: 'Magni suscipit eius consectetur enim et ex et commodi.',
noteId: '545',
};
-
- wrapper = createComponentWrapper();
});
afterEach(() => {
@@ -50,6 +48,10 @@ describe('issue_note_form component', () => {
});
describe('noteHash', () => {
+ beforeEach(() => {
+ wrapper = createComponentWrapper();
+ });
+
it('returns note hash string based on `noteId`', () => {
expect(wrapper.vm.noteHash).toBe(`#note_${props.noteId}`);
});
@@ -71,6 +73,10 @@ describe('issue_note_form component', () => {
});
describe('conflicts editing', () => {
+ beforeEach(() => {
+ wrapper = createComponentWrapper();
+ });
+
it('should show conflict message if note changes outside the component', done => {
wrapper.setProps({
...props,
@@ -100,6 +106,10 @@ describe('issue_note_form component', () => {
});
describe('form', () => {
+ beforeEach(() => {
+ wrapper = createComponentWrapper();
+ });
+
it('should render text area with placeholder', () => {
const textarea = wrapper.find('textarea');
@@ -198,10 +208,6 @@ describe('issue_note_form component', () => {
});
describe('with autosaveKey', () => {
- beforeEach(() => {
- wrapper.destroy();
- });
-
describe('with draft', () => {
beforeEach(done => {
Object.assign(props, {