summaryrefslogtreecommitdiff
path: root/spec/frontend/notes
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 06:08:49 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 06:08:49 +0000
commit6305f1dc00870f6e0635e2e850538a00bbd00bda (patch)
tree8a518cae3805b8d7269bfacc8ae60aa441fadb22 /spec/frontend/notes
parent1d388ed855838a2d50588c131f9f23815f148344 (diff)
downloadgitlab-ce-6305f1dc00870f6e0635e2e850538a00bbd00bda.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes')
-rw-r--r--spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap2
-rw-r--r--spec/frontend/notes/components/discussion_actions_spec.js9
-rw-r--r--spec/frontend/notes/components/discussion_jump_to_next_button_spec.js11
-rw-r--r--spec/frontend/notes/components/discussion_keyboard_navigator_spec.js12
-rw-r--r--spec/frontend/notes/stores/mutation_spec.js2
5 files changed, 8 insertions, 28 deletions
diff --git a/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap b/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap
index 1e466f266ed..2f4c114dd3d 100644
--- a/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap
+++ b/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap
@@ -7,7 +7,7 @@ exports[`JumpToNextDiscussionButton matches the snapshot 1`] = `
>
<button
class="btn btn-default discussion-next-btn"
- title="Jump to next unresolved discussion"
+ title="Jump to next unresolved thread"
>
<icon-stub
name="comment-next"
diff --git a/spec/frontend/notes/components/discussion_actions_spec.js b/spec/frontend/notes/components/discussion_actions_spec.js
index 2d95a86d8a6..5101b81e3ee 100644
--- a/spec/frontend/notes/components/discussion_actions_spec.js
+++ b/spec/frontend/notes/components/discussion_actions_spec.js
@@ -120,14 +120,5 @@ describe('DiscussionActions', () => {
.trigger('click');
expect(wrapper.vm.$emit).toHaveBeenCalledWith('resolve');
});
-
- it('emits jumpToNextDiscussion event when clicking on jump to next discussion button', () => {
- jest.spyOn(wrapper.vm, '$emit');
- wrapper
- .find(JumpToNextDiscussionButton)
- .find('button')
- .trigger('click');
- expect(wrapper.vm.$emit).toHaveBeenCalledWith('jumpToNextDiscussion');
- });
});
});
diff --git a/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js b/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js
index 58cdf3cb57e..a00dd445c4f 100644
--- a/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js
+++ b/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js
@@ -15,15 +15,4 @@ describe('JumpToNextDiscussionButton', () => {
it('matches the snapshot', () => {
expect(wrapper.vm.$el).toMatchSnapshot();
});
-
- it('emits onClick event on button click', () => {
- const button = wrapper.find({ ref: 'button' });
-
- button.trigger('click');
-
- return wrapper.vm.$nextTick().then(() => {
- expect(wrapper.emitted().onClick).toBeTruthy();
- expect(wrapper.emitted().onClick.length).toBe(1);
- });
- });
});
diff --git a/spec/frontend/notes/components/discussion_keyboard_navigator_spec.js b/spec/frontend/notes/components/discussion_keyboard_navigator_spec.js
index b38cfa8fb4a..74e827784ec 100644
--- a/spec/frontend/notes/components/discussion_keyboard_navigator_spec.js
+++ b/spec/frontend/notes/components/discussion_keyboard_navigator_spec.js
@@ -53,13 +53,15 @@ describe('notes/components/discussion_keyboard_navigator', () => {
});
describe.each`
- isDiffView | expectedNextId | expectedPrevId
- ${true} | ${NEXT_DIFF_ID} | ${PREV_DIFF_ID}
- ${false} | ${NEXT_ID} | ${PREV_ID}
- `('when isDiffView is $isDiffView', ({ isDiffView, expectedNextId, expectedPrevId }) => {
+ currentAction | expectedNextId | expectedPrevId
+ ${'diffs'} | ${NEXT_DIFF_ID} | ${PREV_DIFF_ID}
+ ${'show'} | ${NEXT_ID} | ${PREV_ID}
+ `('when isDiffView is $isDiffView', ({ currentAction, expectedNextId, expectedPrevId }) => {
beforeEach(() => {
- createComponent({ propsData: { isDiffView } });
+ window.mrTabs = { currentAction };
+ createComponent();
});
+ afterEach(() => delete window.mrTabs);
it('calls jumpToNextDiscussion when pressing `n`', () => {
Mousetrap.trigger('n');
diff --git a/spec/frontend/notes/stores/mutation_spec.js b/spec/frontend/notes/stores/mutation_spec.js
index 49debe348e2..46b4081f6f6 100644
--- a/spec/frontend/notes/stores/mutation_spec.js
+++ b/spec/frontend/notes/stores/mutation_spec.js
@@ -501,7 +501,6 @@ describe('Notes Store mutations', () => {
expect.objectContaining({
resolvableDiscussionsCount: 1,
unresolvedDiscussionsCount: 1,
- hasUnresolvedDiscussions: false,
}),
);
});
@@ -538,7 +537,6 @@ describe('Notes Store mutations', () => {
expect.objectContaining({
resolvableDiscussionsCount: 4,
unresolvedDiscussionsCount: 2,
- hasUnresolvedDiscussions: true,
}),
);
});