diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-05 21:07:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-05 21:07:51 +0300 |
commit | 6a7cc8c14727f6fac64a5be6838764d8d5d41468 (patch) | |
tree | 97c8a3c2f180d26f0f8f0baaa3230352b8ef1efb /spec/frontend/notes/components | |
parent | 872319738757edc0483346c75a2407f7019b963f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes/components')
-rw-r--r-- | spec/frontend/notes/components/note_app_spec.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/frontend/notes/components/note_app_spec.js b/spec/frontend/notes/components/note_app_spec.js index 3716b349210..3c960adb698 100644 --- a/spec/frontend/notes/components/note_app_spec.js +++ b/spec/frontend/notes/components/note_app_spec.js @@ -1,13 +1,13 @@ import $ from 'helpers/jquery'; import AxiosMockAdapter from 'axios-mock-adapter'; -import axios from '~/lib/utils/axios_utils'; import Vue from 'vue'; import { mount, createLocalVue } from '@vue/test-utils'; +import { setTestTimeout } from 'helpers/timeout'; +import axios from '~/lib/utils/axios_utils'; import NotesApp from '~/notes/components/notes_app.vue'; import service from '~/notes/services/notes_service'; import createStore from '~/notes/stores'; import '~/behaviors/markdown/render_gfm'; -import { setTestTimeout } from 'helpers/timeout'; // TODO: use generated fixture (https://gitlab.com/gitlab-org/gitlab-foss/issues/62491) import * as mockData from '../../notes/mock_data'; import * as urlUtility from '~/lib/utils/url_utility'; @@ -77,6 +77,8 @@ describe('note_app', () => { describe('set data', () => { beforeEach(() => { + setFixtures('<div class="js-discussions-count"></div>'); + axiosMock.onAny().reply(200, []); wrapper = mountComponent(); return waitForDiscussionsRequest(); @@ -97,6 +99,10 @@ describe('note_app', () => { it('should fetch discussions', () => { expect(store.state.discussions).toEqual([]); }); + + it('updates discussions badge', () => { + expect(document.querySelector('.js-discussions-count').textContent).toEqual('0'); + }); }); describe('render', () => { @@ -161,6 +167,7 @@ describe('note_app', () => { describe('while fetching data', () => { beforeEach(() => { + setFixtures('<div class="js-discussions-count"></div>'); axiosMock.onAny().reply(200, []); wrapper = mountComponent(); }); @@ -177,6 +184,10 @@ describe('note_app', () => { 'Write a comment or drag your files hereā¦', ); }); + + it('should not update discussions badge (it should be blank)', () => { + expect(document.querySelector('.js-discussions-count').textContent).toEqual(''); + }); }); describe('update note', () => { |