summaryrefslogtreecommitdiff
path: root/spec/frontend/issues/show/components/locked_warning_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/issues/show/components/locked_warning_spec.js')
-rw-r--r--spec/frontend/issues/show/components/locked_warning_spec.js61
1 files changed, 29 insertions, 32 deletions
diff --git a/spec/frontend/issues/show/components/locked_warning_spec.js b/spec/frontend/issues/show/components/locked_warning_spec.js
index 08f0338d41b..dd3c7c58380 100644
--- a/spec/frontend/issues/show/components/locked_warning_spec.js
+++ b/spec/frontend/issues/show/components/locked_warning_spec.js
@@ -1,7 +1,7 @@
import { GlAlert, GlLink } from '@gitlab/ui';
import { mountExtended } from 'helpers/vue_test_utils_helper';
import { sprintf } from '~/locale';
-import { IssuableType } from '~/issues/constants';
+import { TYPE_EPIC, TYPE_ISSUE } from '~/issues/constants';
import LockedWarning, { i18n } from '~/issues/show/components/locked_warning.vue';
describe('LockedWarning component', () => {
@@ -21,35 +21,32 @@ describe('LockedWarning component', () => {
const findAlert = () => wrapper.findComponent(GlAlert);
const findLink = () => wrapper.findComponent(GlLink);
- describe.each([IssuableType.Issue, IssuableType.Epic])(
- 'with issuableType set to %s',
- (issuableType) => {
- let alert;
- let link;
- beforeEach(() => {
- createComponent({ issuableType });
- alert = findAlert();
- link = findLink();
- });
-
- afterEach(() => {
- alert = null;
- link = null;
- });
-
- it('displays a non-closable alert', () => {
- expect(alert.exists()).toBe(true);
- expect(alert.props('dismissible')).toBe(false);
- });
-
- it(`displays correct message`, async () => {
- expect(alert.text()).toMatchInterpolatedText(sprintf(i18n.alertMessage, { issuableType }));
- });
-
- it(`displays a link with correct text`, async () => {
- expect(link.exists()).toBe(true);
- expect(link.text()).toBe(`the ${issuableType}`);
- });
- },
- );
+ describe.each([TYPE_ISSUE, TYPE_EPIC])('with issuableType set to %s', (issuableType) => {
+ let alert;
+ let link;
+ beforeEach(() => {
+ createComponent({ issuableType });
+ alert = findAlert();
+ link = findLink();
+ });
+
+ afterEach(() => {
+ alert = null;
+ link = null;
+ });
+
+ it('displays a non-closable alert', () => {
+ expect(alert.exists()).toBe(true);
+ expect(alert.props('dismissible')).toBe(false);
+ });
+
+ it(`displays correct message`, async () => {
+ expect(alert.text()).toMatchInterpolatedText(sprintf(i18n.alertMessage, { issuableType }));
+ });
+
+ it(`displays a link with correct text`, async () => {
+ expect(link.exists()).toBe(true);
+ expect(link.text()).toBe(`the ${issuableType}`);
+ });
+ });
});