summaryrefslogtreecommitdiff
path: root/spec/frontend/diffs/components/diff_gutter_avatars_spec.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-19 23:18:09 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-19 23:18:09 +0000
commit6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch)
treedc4d20fe6064752c0bd323187252c77e0a89144b /spec/frontend/diffs/components/diff_gutter_avatars_spec.js
parent9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff)
downloadgitlab-ce-6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde.tar.gz
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/frontend/diffs/components/diff_gutter_avatars_spec.js')
-rw-r--r--spec/frontend/diffs/components/diff_gutter_avatars_spec.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/frontend/diffs/components/diff_gutter_avatars_spec.js b/spec/frontend/diffs/components/diff_gutter_avatars_spec.js
index c18f0b721da..f13988fc11f 100644
--- a/spec/frontend/diffs/components/diff_gutter_avatars_spec.js
+++ b/spec/frontend/diffs/components/diff_gutter_avatars_spec.js
@@ -1,6 +1,7 @@
import { shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
import DiffGutterAvatars from '~/diffs/components/diff_gutter_avatars.vue';
+import { HIDE_COMMENTS } from '~/diffs/i18n';
import discussionsMockData from '../mock_data/diff_discussions';
const getDiscussionsMockData = () => [{ ...discussionsMockData }];
@@ -40,7 +41,12 @@ describe('DiffGutterAvatars', () => {
findCollapseButton().trigger('click');
await nextTick();
- expect(wrapper.emitted().toggleLineDiscussions).toBeTruthy();
+ expect(wrapper.emitted().toggleLineDiscussions).toBeDefined();
+ });
+
+ it('renders the proper title and aria-label', () => {
+ expect(findCollapseButton().attributes('title')).toBe(HIDE_COMMENTS);
+ expect(findCollapseButton().attributes('aria-label')).toBe(HIDE_COMMENTS);
});
});
@@ -69,14 +75,14 @@ describe('DiffGutterAvatars', () => {
findUserAvatars().at(0).trigger('click');
await nextTick();
- expect(wrapper.emitted().toggleLineDiscussions).toBeTruthy();
+ expect(wrapper.emitted().toggleLineDiscussions).toBeDefined();
});
it('should emit toggleDiscussions event on more count text click', async () => {
findMoreCount().trigger('click');
await nextTick();
- expect(wrapper.emitted().toggleLineDiscussions).toBeTruthy();
+ expect(wrapper.emitted().toggleLineDiscussions).toBeDefined();
});
});