summaryrefslogtreecommitdiff
path: root/spec/frontend/projects/settings/branch_rules/components/protections/merge_protections_spec.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
commitee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch)
treef8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/frontend/projects/settings/branch_rules/components/protections/merge_protections_spec.js
parent62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff)
downloadgitlab-ce-ee664acb356f8123f4f6b00b73c1e1cf0866c7fb.tar.gz
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/frontend/projects/settings/branch_rules/components/protections/merge_protections_spec.js')
-rw-r--r--spec/frontend/projects/settings/branch_rules/components/protections/merge_protections_spec.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/spec/frontend/projects/settings/branch_rules/components/protections/merge_protections_spec.js b/spec/frontend/projects/settings/branch_rules/components/protections/merge_protections_spec.js
deleted file mode 100644
index 0e168a2ad78..00000000000
--- a/spec/frontend/projects/settings/branch_rules/components/protections/merge_protections_spec.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import { GlFormGroup, GlFormCheckbox } from '@gitlab/ui';
-import { mountExtended } from 'helpers/vue_test_utils_helper';
-import MergeProtections, {
- i18n,
-} from '~/projects/settings/branch_rules/components/protections/merge_protections.vue';
-import { membersAllowedToMerge, requireCodeOwnersApproval } from '../../mock_data';
-
-describe('Merge Protections', () => {
- let wrapper;
-
- const propsData = {
- membersAllowedToMerge,
- requireCodeOwnersApproval,
- };
-
- const createComponent = () => {
- wrapper = mountExtended(MergeProtections, {
- propsData,
- });
- };
-
- const findFormGroup = () => wrapper.findComponent(GlFormGroup);
- const findCodeOwnersApprovalCheckbox = () => wrapper.findComponent(GlFormCheckbox);
-
- beforeEach(() => createComponent());
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- it('renders a form group with the correct label', () => {
- expect(findFormGroup().text()).toContain(i18n.allowedToMerge);
- });
-
- describe('Require code owners approval checkbox', () => {
- it('renders a checkbox with the correct props', () => {
- expect(findCodeOwnersApprovalCheckbox().vm.$attrs.checked).toBe(
- propsData.requireCodeOwnersApproval,
- );
- });
-
- it('renders help text', () => {
- expect(findCodeOwnersApprovalCheckbox().text()).toContain(i18n.requireApprovalTitle);
- expect(findCodeOwnersApprovalCheckbox().text()).toContain(i18n.requireApprovalHelpText);
- });
-
- it('emits a change-allow-force-push event when changed', () => {
- findCodeOwnersApprovalCheckbox().vm.$emit('change', false);
-
- expect(wrapper.emitted('change-require-code-owners-approval')[0]).toEqual([false]);
- });
- });
-});