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:
Diffstat (limited to 'spec/frontend/vue_alerts_spec.js')
-rw-r--r--spec/frontend/vue_alerts_spec.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/frontend/vue_alerts_spec.js b/spec/frontend/vue_alerts_spec.js
index de2faa09438..be4a45639cf 100644
--- a/spec/frontend/vue_alerts_spec.js
+++ b/spec/frontend/vue_alerts_spec.js
@@ -1,4 +1,5 @@
import { nextTick } from 'vue';
+import { alertVariantOptions } from '@gitlab/ui/dist/utils/constants';
import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures';
import { TEST_HOST } from 'helpers/test_constants';
import initVueAlerts from '~/vue_alerts';
@@ -55,7 +56,11 @@ describe('VueAlerts', () => {
primaryButtonText: alert.querySelector('.gl-alert-action').textContent.trim(),
primaryButtonLink: alert.querySelector('.gl-alert-action').href,
variant: [...alert.classList]
- .find((x) => x.match(/gl-alert-(?!not-dismissible)/))
+ .find((cssClass) => {
+ return Object.values(alertVariantOptions).some(
+ (variant) => cssClass === `gl-alert-${variant}`,
+ );
+ })
.replace('gl-alert-', ''),
});