summaryrefslogtreecommitdiff
path: root/spec/frontend/runner/components/runner_type_badge_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/runner/components/runner_type_badge_spec.js')
-rw-r--r--spec/frontend/runner/components/runner_type_badge_spec.js66
1 files changed, 0 insertions, 66 deletions
diff --git a/spec/frontend/runner/components/runner_type_badge_spec.js b/spec/frontend/runner/components/runner_type_badge_spec.js
deleted file mode 100644
index fe922fb9d18..00000000000
--- a/spec/frontend/runner/components/runner_type_badge_spec.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import { GlBadge } from '@gitlab/ui';
-import { shallowMount } from '@vue/test-utils';
-import RunnerTypeBadge from '~/runner/components/runner_type_badge.vue';
-import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
-import {
- INSTANCE_TYPE,
- GROUP_TYPE,
- PROJECT_TYPE,
- I18N_INSTANCE_TYPE,
- I18N_GROUP_TYPE,
- I18N_PROJECT_TYPE,
-} from '~/runner/constants';
-
-describe('RunnerTypeBadge', () => {
- let wrapper;
-
- const findBadge = () => wrapper.findComponent(GlBadge);
- const getTooltip = () => getBinding(findBadge().element, 'gl-tooltip');
-
- const createComponent = ({ props = {} } = {}) => {
- wrapper = shallowMount(RunnerTypeBadge, {
- propsData: {
- ...props,
- },
- directives: {
- GlTooltip: createMockDirective(),
- },
- });
- };
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- describe.each`
- type | text
- ${INSTANCE_TYPE} | ${I18N_INSTANCE_TYPE}
- ${GROUP_TYPE} | ${I18N_GROUP_TYPE}
- ${PROJECT_TYPE} | ${I18N_PROJECT_TYPE}
- `('displays $type runner', ({ type, text }) => {
- beforeEach(() => {
- createComponent({ props: { type } });
- });
-
- it(`as "${text}" with an "info" variant`, () => {
- expect(findBadge().text()).toBe(text);
- expect(findBadge().props('variant')).toBe('muted');
- });
-
- it('with a tooltip', () => {
- expect(getTooltip().value).toBeDefined();
- });
- });
-
- it('validation fails for an incorrect type', () => {
- expect(() => {
- createComponent({ props: { type: 'AN_UNKNOWN_VALUE' } });
- }).toThrow();
- });
-
- it('does not render content when type is missing', () => {
- createComponent({ props: { type: undefined } });
-
- expect(findBadge().exists()).toBe(false);
- });
-});