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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-10 12:09:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-10 12:09:29 +0300
commit921173681c207356914a35ea3dca1afffeac8b05 (patch)
tree45f0b49531b549dd7e28dd22744f822a214390a4 /spec/frontend/notes
parente0df70a614e6381d1ccb9547f23c797063ba6dfc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes')
-rw-r--r--spec/frontend/notes/components/note_actions_spec.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/frontend/notes/components/note_actions_spec.js b/spec/frontend/notes/components/note_actions_spec.js
index 17717ebd09a..f56be1a9af7 100644
--- a/spec/frontend/notes/components/note_actions_spec.js
+++ b/spec/frontend/notes/components/note_actions_spec.js
@@ -6,6 +6,7 @@ import axios from '~/lib/utils/axios_utils';
import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants';
import noteActions from '~/notes/components/note_actions.vue';
import createStore from '~/notes/stores';
+import UserAccessRoleBadge from '~/vue_shared/components/user_access_role_badge.vue';
import { userDataMock } from '../mock_data';
describe('noteActions', () => {
@@ -15,6 +16,9 @@ describe('noteActions', () => {
let actions;
let axiosMock;
+ const findUserAccessRoleBadge = (idx) => wrapper.findAll(UserAccessRoleBadge).at(idx);
+ const findUserAccessRoleBadgeText = (idx) => findUserAccessRoleBadge(idx).text().trim();
+
const mountNoteActions = (propsData, computed) => {
const localVue = createLocalVue();
return mount(localVue.extend(noteActions), {
@@ -66,11 +70,11 @@ describe('noteActions', () => {
});
it('should render noteable author badge', () => {
- expect(wrapper.findAll('.note-role').at(0).text().trim()).toEqual('Author');
+ expect(findUserAccessRoleBadgeText(0)).toBe('Author');
});
it('should render access level badge', () => {
- expect(wrapper.findAll('.note-role').at(1).text().trim()).toEqual(props.accessLevel);
+ expect(findUserAccessRoleBadgeText(1)).toBe(props.accessLevel);
});
it('should render contributor badge', () => {
@@ -80,7 +84,7 @@ describe('noteActions', () => {
});
return wrapper.vm.$nextTick().then(() => {
- expect(wrapper.findAll('.note-role').at(1).text().trim()).toBe('Contributor');
+ expect(findUserAccessRoleBadgeText(1)).toBe('Contributor');
});
});