From 36a59d088eca61b834191dacea009677a96c052f Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 19 May 2022 07:33:21 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-0-stable-ee --- .../protected_branches/protected_branch_create_spec.js | 7 ++++++- spec/frontend/protected_branches/protected_branch_edit_spec.js | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'spec/frontend/protected_branches') diff --git a/spec/frontend/protected_branches/protected_branch_create_spec.js b/spec/frontend/protected_branches/protected_branch_create_spec.js index b3de2d5e031..4b634c52b01 100644 --- a/spec/frontend/protected_branches/protected_branch_create_spec.js +++ b/spec/frontend/protected_branches/protected_branch_create_spec.js @@ -1,3 +1,4 @@ +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import ProtectedBranchCreate from '~/protected_branches/protected_branch_create'; const FORCE_PUSH_TOGGLE_TESTID = 'force-push-toggle'; @@ -21,7 +22,7 @@ describe('ProtectedBranchCreate', () => { codeOwnerToggleChecked = false, hasLicense = true, } = {}) => { - setFixtures(` + setHTMLFixture(`
{ return new ProtectedBranchCreate({ hasLicense }); }; + afterEach(() => { + resetHTMLFixture(); + }); + describe('when license supports code owner approvals', () => { it('instantiates the code owner toggle', () => { create(); diff --git a/spec/frontend/protected_branches/protected_branch_edit_spec.js b/spec/frontend/protected_branches/protected_branch_edit_spec.js index 959ca6ecde2..d842e00d850 100644 --- a/spec/frontend/protected_branches/protected_branch_edit_spec.js +++ b/spec/frontend/protected_branches/protected_branch_edit_spec.js @@ -1,5 +1,6 @@ import MockAdapter from 'axios-mock-adapter'; import $ from 'jquery'; +import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { TEST_HOST } from 'helpers/test_constants'; import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; @@ -33,7 +34,7 @@ describe('ProtectedBranchEdit', () => { codeOwnerToggleChecked = false, hasLicense = true, } = {}) => { - setFixtures(`
+ setHTMLFixture(`
{ afterEach(() => { mock.restore(); + resetHTMLFixture(); }); describe('when license supports code owner approvals', () => { @@ -76,7 +78,11 @@ describe('ProtectedBranchEdit', () => { describe('when toggles are not available in the DOM on page load', () => { beforeEach(() => { create({ hasLicense: true }); - setFixtures(''); + setHTMLFixture(''); + }); + + afterEach(() => { + resetHTMLFixture(); }); it('does not instantiate the force push toggle', () => { -- cgit v1.2.3