summaryrefslogtreecommitdiff
path: root/spec/frontend/admin/topics/components/remove_avatar_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/admin/topics/components/remove_avatar_spec.js')
-rw-r--r--spec/frontend/admin/topics/components/remove_avatar_spec.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/frontend/admin/topics/components/remove_avatar_spec.js b/spec/frontend/admin/topics/components/remove_avatar_spec.js
index d4656f0a199..97d257c682c 100644
--- a/spec/frontend/admin/topics/components/remove_avatar_spec.js
+++ b/spec/frontend/admin/topics/components/remove_avatar_spec.js
@@ -1,10 +1,11 @@
-import { GlButton, GlModal } from '@gitlab/ui';
+import { GlButton, GlModal, GlSprintf } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import RemoveAvatar from '~/admin/topics/components/remove_avatar.vue';
const modalID = 'fake-id';
const path = 'topic/path/1';
+const name = 'Topic 1';
jest.mock('lodash/uniqueId', () => () => 'fake-id');
jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' }));
@@ -16,10 +17,14 @@ describe('RemoveAvatar', () => {
wrapper = shallowMount(RemoveAvatar, {
provide: {
path,
+ name,
},
directives: {
GlModal: createMockDirective(),
},
+ stubs: {
+ GlSprintf,
+ },
});
};
@@ -55,8 +60,8 @@ describe('RemoveAvatar', () => {
const modal = findModal();
expect(modal.exists()).toBe(true);
- expect(modal.props('title')).toBe('Confirm remove avatar');
- expect(modal.text()).toBe('Avatar will be removed. Are you sure?');
+ expect(modal.props('title')).toBe('Remove topic avatar');
+ expect(modal.text()).toBe(`Topic avatar for ${name} will be removed. This cannot be undone.`);
});
it('contains the correct modal ID', () => {