summaryrefslogtreecommitdiff
path: root/spec/frontend/ide/stores/mutations/alert_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/ide/stores/mutations/alert_spec.js')
-rw-r--r--spec/frontend/ide/stores/mutations/alert_spec.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/frontend/ide/stores/mutations/alert_spec.js b/spec/frontend/ide/stores/mutations/alert_spec.js
new file mode 100644
index 00000000000..2840ec4ebb7
--- /dev/null
+++ b/spec/frontend/ide/stores/mutations/alert_spec.js
@@ -0,0 +1,26 @@
+import * as types from '~/ide/stores/mutation_types';
+import mutations from '~/ide/stores/mutations/alert';
+
+describe('~/ide/stores/mutations/alert', () => {
+ const state = {};
+
+ describe(types.DETECT_ENVIRONMENTS_GUIDANCE_ALERT, () => {
+ it('checks the stages for any that configure environments', () => {
+ mutations[types.DETECT_ENVIRONMENTS_GUIDANCE_ALERT](state, {
+ nodes: [{ groups: { nodes: [{ jobs: { nodes: [{}] } }] } }],
+ });
+ expect(state.environmentsGuidanceAlertDetected).toBe(true);
+ mutations[types.DETECT_ENVIRONMENTS_GUIDANCE_ALERT](state, {
+ nodes: [{ groups: { nodes: [{ jobs: { nodes: [{ environment: {} }] } }] } }],
+ });
+ expect(state.environmentsGuidanceAlertDetected).toBe(false);
+ });
+ });
+
+ describe(types.DISMISS_ENVIRONMENTS_GUIDANCE_ALERT, () => {
+ it('stops environments guidance', () => {
+ mutations[types.DISMISS_ENVIRONMENTS_GUIDANCE_ALERT](state);
+ expect(state.environmentsGuidanceAlertDismissed).toBe(true);
+ });
+ });
+});