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/projects/settings/branch_rules/components/protections/index_spec.js')
-rw-r--r--spec/frontend/projects/settings/branch_rules/components/protections/index_spec.js57
1 files changed, 0 insertions, 57 deletions
diff --git a/spec/frontend/projects/settings/branch_rules/components/protections/index_spec.js b/spec/frontend/projects/settings/branch_rules/components/protections/index_spec.js
deleted file mode 100644
index 3592fa50622..00000000000
--- a/spec/frontend/projects/settings/branch_rules/components/protections/index_spec.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import { nextTick } from 'vue';
-import { GlLink } from '@gitlab/ui';
-import { mountExtended } from 'helpers/vue_test_utils_helper';
-import Protections, {
- i18n,
-} from '~/projects/settings/branch_rules/components/protections/index.vue';
-import PushProtections from '~/projects/settings/branch_rules/components/protections/push_protections.vue';
-import MergeProtections from '~/projects/settings/branch_rules/components/protections/merge_protections.vue';
-import { protections } from '../../mock_data';
-
-describe('Branch Protections', () => {
- let wrapper;
-
- const createComponent = async () => {
- wrapper = mountExtended(Protections, {
- propsData: { protections },
- });
- await nextTick();
- };
-
- const findHeading = () => wrapper.find('h4');
- const findHelpText = () => wrapper.findByTestId('protections-help-text');
- const findHelpLink = () => wrapper.findComponent(GlLink);
- const findPushProtections = () => wrapper.findComponent(PushProtections);
- const findMergeProtections = () => wrapper.findComponent(MergeProtections);
-
- beforeEach(() => createComponent());
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- it('renders a heading', () => {
- expect(findHeading().text()).toBe(i18n.protections);
- });
-
- it('renders help text', () => {
- expect(findHelpText().text()).toMatchInterpolatedText(i18n.protectionsHelpText);
- expect(findHelpLink().attributes('href')).toBe('/help/user/project/protected_branches');
- });
-
- it('renders a PushProtections component with correct props', () => {
- expect(findPushProtections().props('membersAllowedToPush')).toStrictEqual(
- protections.membersAllowedToPush,
- );
- expect(findPushProtections().props('allowForcePush')).toBe(protections.allowForcePush);
- });
-
- it('renders a MergeProtections component with correct props', () => {
- expect(findMergeProtections().props('membersAllowedToMerge')).toStrictEqual(
- protections.membersAllowedToMerge,
- );
- expect(findMergeProtections().props('requireCodeOwnersApproval')).toBe(
- protections.requireCodeOwnersApproval,
- );
- });
-});