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>2023-05-03 12:09:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-03 12:09:50 +0300
commit29761d24b86b7a091ca83df4e8cd1cc14f81d534 (patch)
treeeb77242b6d1685f14428caad63edd10e71502d02 /spec/frontend/ci/runner
parent74081733481d7d3d480a5e887ac768fe30f84055 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ci/runner')
-rw-r--r--spec/frontend/ci/runner/admin_new_runner_app/admin_new_runner_app_spec.js6
-rw-r--r--spec/frontend/ci/runner/components/registration/registration_feedback_banner_spec.js52
-rw-r--r--spec/frontend/ci/runner/group_new_runner_app/group_new_runner_app_spec.js6
-rw-r--r--spec/frontend/ci/runner/project_new_runner_app/project_new_runner_app_spec.js6
4 files changed, 70 insertions, 0 deletions
diff --git a/spec/frontend/ci/runner/admin_new_runner_app/admin_new_runner_app_spec.js b/spec/frontend/ci/runner/admin_new_runner_app/admin_new_runner_app_spec.js
index dd88720aab6..62aba4e4be6 100644
--- a/spec/frontend/ci/runner/admin_new_runner_app/admin_new_runner_app_spec.js
+++ b/spec/frontend/ci/runner/admin_new_runner_app/admin_new_runner_app_spec.js
@@ -6,6 +6,7 @@ import { createAlert, VARIANT_SUCCESS } from '~/alert';
import AdminNewRunnerApp from '~/ci/runner/admin_new_runner/admin_new_runner_app.vue';
import RegistrationCompatibilityAlert from '~/ci/runner/components/registration/registration_compatibility_alert.vue';
+import RegistrationFeedbackBanner from '~/ci/runner/components/registration/registration_feedback_banner.vue';
import { saveAlertToLocalStorage } from '~/ci/runner/local_storage_alert/save_alert_to_local_storage';
import RunnerPlatformsRadioGroup from '~/ci/runner/components/runner_platforms_radio_group.vue';
import {
@@ -31,6 +32,7 @@ describe('AdminNewRunnerApp', () => {
let wrapper;
const findRunnerPlatformsRadioGroup = () => wrapper.findComponent(RunnerPlatformsRadioGroup);
+ const findRegistrationFeedbackBanner = () => wrapper.findComponent(RegistrationFeedbackBanner);
const findRegistrationCompatibilityAlert = () =>
wrapper.findComponent(RegistrationCompatibilityAlert);
const findRunnerCreateForm = () => wrapper.findComponent(RunnerCreateForm);
@@ -47,6 +49,10 @@ describe('AdminNewRunnerApp', () => {
createComponent();
});
+ it('shows a registration feedback banner', () => {
+ expect(findRegistrationFeedbackBanner().exists()).toBe(true);
+ });
+
it('shows a registration compatibility alert', () => {
expect(findRegistrationCompatibilityAlert().props('alertKey')).toBe(INSTANCE_TYPE);
});
diff --git a/spec/frontend/ci/runner/components/registration/registration_feedback_banner_spec.js b/spec/frontend/ci/runner/components/registration/registration_feedback_banner_spec.js
new file mode 100644
index 00000000000..fa6b7ad7c63
--- /dev/null
+++ b/spec/frontend/ci/runner/components/registration/registration_feedback_banner_spec.js
@@ -0,0 +1,52 @@
+import { GlBanner } from '@gitlab/ui';
+import { shallowMount } from '@vue/test-utils';
+import RegistrationFeedbackBanner from '~/ci/runner/components/registration/registration_feedback_banner.vue';
+import UserCalloutDismisser from '~/vue_shared/components/user_callout_dismisser.vue';
+import { makeMockUserCalloutDismisser } from 'helpers/mock_user_callout_dismisser';
+
+describe('Runner registration feeback banner', () => {
+ let wrapper;
+ let userCalloutDismissSpy;
+
+ const findUserCalloutDismisser = () => wrapper.findComponent(UserCalloutDismisser);
+ const findBanner = () => wrapper.findComponent(GlBanner);
+
+ const createComponent = ({ shouldShowCallout = true } = {}) => {
+ userCalloutDismissSpy = jest.fn();
+
+ wrapper = shallowMount(RegistrationFeedbackBanner, {
+ stubs: {
+ UserCalloutDismisser: makeMockUserCalloutDismisser({
+ dismiss: userCalloutDismissSpy,
+ shouldShowCallout,
+ }),
+ },
+ });
+ };
+
+ it('banner is shown', () => {
+ createComponent();
+
+ expect(findBanner().exists()).toBe(true);
+ });
+
+ it('dismisses the callout when closed', () => {
+ createComponent();
+
+ findBanner().vm.$emit('close');
+
+ expect(userCalloutDismissSpy).toHaveBeenCalled();
+ });
+
+ it('sets feature name to create_runner_workflow_banner', () => {
+ createComponent();
+
+ expect(findUserCalloutDismisser().props('featureName')).toBe('create_runner_workflow_banner');
+ });
+
+ it('is not displayed once it has been dismissed', () => {
+ createComponent({ shouldShowCallout: false });
+
+ expect(findBanner().exists()).toBe(false);
+ });
+});
diff --git a/spec/frontend/ci/runner/group_new_runner_app/group_new_runner_app_spec.js b/spec/frontend/ci/runner/group_new_runner_app/group_new_runner_app_spec.js
index ef8a2df1478..e2cf46023b1 100644
--- a/spec/frontend/ci/runner/group_new_runner_app/group_new_runner_app_spec.js
+++ b/spec/frontend/ci/runner/group_new_runner_app/group_new_runner_app_spec.js
@@ -6,6 +6,7 @@ import { createAlert, VARIANT_SUCCESS } from '~/alert';
import GroupRunnerRunnerApp from '~/ci/runner/group_new_runner/group_new_runner_app.vue';
import RegistrationCompatibilityAlert from '~/ci/runner/components/registration/registration_compatibility_alert.vue';
+import RegistrationFeedbackBanner from '~/ci/runner/components/registration/registration_feedback_banner.vue';
import { saveAlertToLocalStorage } from '~/ci/runner/local_storage_alert/save_alert_to_local_storage';
import RunnerPlatformsRadioGroup from '~/ci/runner/components/runner_platforms_radio_group.vue';
import {
@@ -33,6 +34,7 @@ describe('GroupRunnerRunnerApp', () => {
let wrapper;
const findRunnerPlatformsRadioGroup = () => wrapper.findComponent(RunnerPlatformsRadioGroup);
+ const findRegistrationFeedbackBanner = () => wrapper.findComponent(RegistrationFeedbackBanner);
const findRegistrationCompatibilityAlert = () =>
wrapper.findComponent(RegistrationCompatibilityAlert);
const findRunnerCreateForm = () => wrapper.findComponent(RunnerCreateForm);
@@ -52,6 +54,10 @@ describe('GroupRunnerRunnerApp', () => {
createComponent();
});
+ it('shows a registration feedback banner', () => {
+ expect(findRegistrationFeedbackBanner().exists()).toBe(true);
+ });
+
it('shows a registration compatibility alert', () => {
expect(findRegistrationCompatibilityAlert().props('alertKey')).toBe(mockGroupId);
});
diff --git a/spec/frontend/ci/runner/project_new_runner_app/project_new_runner_app_spec.js b/spec/frontend/ci/runner/project_new_runner_app/project_new_runner_app_spec.js
index 9a7a89feb4e..4bb5b25fe15 100644
--- a/spec/frontend/ci/runner/project_new_runner_app/project_new_runner_app_spec.js
+++ b/spec/frontend/ci/runner/project_new_runner_app/project_new_runner_app_spec.js
@@ -6,6 +6,7 @@ import { createAlert, VARIANT_SUCCESS } from '~/alert';
import ProjectRunnerRunnerApp from '~/ci/runner/project_new_runner/project_new_runner_app.vue';
import RegistrationCompatibilityAlert from '~/ci/runner/components/registration/registration_compatibility_alert.vue';
+import RegistrationFeedbackBanner from '~/ci/runner/components/registration/registration_feedback_banner.vue';
import { saveAlertToLocalStorage } from '~/ci/runner/local_storage_alert/save_alert_to_local_storage';
import RunnerPlatformsRadioGroup from '~/ci/runner/components/runner_platforms_radio_group.vue';
import {
@@ -33,6 +34,7 @@ describe('ProjectRunnerRunnerApp', () => {
let wrapper;
const findRunnerPlatformsRadioGroup = () => wrapper.findComponent(RunnerPlatformsRadioGroup);
+ const findRegistrationFeedbackBanner = () => wrapper.findComponent(RegistrationFeedbackBanner);
const findRegistrationCompatibilityAlert = () =>
wrapper.findComponent(RegistrationCompatibilityAlert);
const findRunnerCreateForm = () => wrapper.findComponent(RunnerCreateForm);
@@ -53,6 +55,10 @@ describe('ProjectRunnerRunnerApp', () => {
createComponent();
});
+ it('shows a registration feedback banner', () => {
+ expect(findRegistrationFeedbackBanner().exists()).toBe(true);
+ });
+
it('shows a registration compatibility alert', () => {
expect(findRegistrationCompatibilityAlert().props('alertKey')).toBe(mockProjectId);
});