Commit 771c02d8 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '327686-update-approvals-specs' into 'master'

Update default branch name in approvals specs

See merge request gitlab-org/gitlab!59995
parents df540313 9c400c57
...@@ -9,7 +9,7 @@ import waitForPromises from 'helpers/wait_for_promises'; ...@@ -9,7 +9,7 @@ import waitForPromises from 'helpers/wait_for_promises';
const TEST_DEFAULT_BRANCH = { name: 'Any branch' }; const TEST_DEFAULT_BRANCH = { name: 'Any branch' };
const TEST_PROJECT_ID = '1'; const TEST_PROJECT_ID = '1';
const TEST_PROTECTED_BRANCHES = [ const TEST_PROTECTED_BRANCHES = [
{ id: 1, name: 'master' }, { id: 1, name: 'main' },
{ id: 2, name: 'development' }, { id: 2, name: 'development' },
]; ];
const TEST_BRANCHES_SELECTIONS = [TEST_DEFAULT_BRANCH, ...TEST_PROTECTED_BRANCHES]; const TEST_BRANCHES_SELECTIONS = [TEST_DEFAULT_BRANCH, ...TEST_PROTECTED_BRANCHES];
...@@ -61,7 +61,7 @@ describe('Branches Select', () => { ...@@ -61,7 +61,7 @@ describe('Branches Select', () => {
protectedBranches: [ protectedBranches: [
{ {
id: 1, id: 1,
name: 'master', name: 'main',
}, },
], ],
}, },
...@@ -70,10 +70,10 @@ describe('Branches Select', () => { ...@@ -70,10 +70,10 @@ describe('Branches Select', () => {
); );
await waitForPromises(); await waitForPromises();
expect(findDropdown().props('text')).toBe('master'); expect(findDropdown().props('text')).toBe('main');
expect( expect(
findDropdownItems() findDropdownItems()
.filter((item) => item.text() === 'master') .filter((item) => item.text() === 'main')
.at(0) .at(0)
.props('isChecked'), .props('isChecked'),
).toBe(true); ).toBe(true);
...@@ -108,7 +108,7 @@ describe('Branches Select', () => { ...@@ -108,7 +108,7 @@ describe('Branches Select', () => {
}); });
it('fetches protected branches with no any branch if there is a search', async () => { it('fetches protected branches with no any branch if there is a search', async () => {
findSearch().vm.$emit('input', 'master'); findSearch().vm.$emit('input', 'main');
await waitForPromises(); await waitForPromises();
expect(findDropdownItems()).toHaveLength(protectedBranchNames().length); expect(findDropdownItems()).toHaveLength(protectedBranchNames().length);
......
...@@ -50,7 +50,7 @@ describe('EE Approvals MRRules', () => { ...@@ -50,7 +50,7 @@ describe('EE Approvals MRRules', () => {
store.modules.approvals.state = { store.modules.approvals.state = {
hasLoaded: true, hasLoaded: true,
rules: [], rules: [],
targetBranch: 'master', targetBranch: 'main',
}; };
store.modules.approvals.actions.putRule = jest.fn(); store.modules.approvals.actions.putRule = jest.fn();
}); });
...@@ -64,7 +64,7 @@ describe('EE Approvals MRRules', () => { ...@@ -64,7 +64,7 @@ describe('EE Approvals MRRules', () => {
}); });
describe('when editing a MR', () => { describe('when editing a MR', () => {
const initialTargetBranch = 'master'; const initialTargetBranch = 'main';
let targetBranchInputElement; let targetBranchInputElement;
beforeEach(() => { beforeEach(() => {
...@@ -96,7 +96,7 @@ describe('EE Approvals MRRules', () => { ...@@ -96,7 +96,7 @@ describe('EE Approvals MRRules', () => {
it('re-fetches rules when target branch has changed', () => { it('re-fetches rules when target branch has changed', () => {
factory(); factory();
store.modules.approvals.state.targetBranch = 'master123'; store.modules.approvals.state.targetBranch = 'main123';
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(store.modules.approvals.actions.fetchRules).toHaveBeenCalled(); expect(store.modules.approvals.actions.fetchRules).toHaveBeenCalled();
......
...@@ -32,7 +32,7 @@ describe('Rule Branches', () => { ...@@ -32,7 +32,7 @@ describe('Rule Branches', () => {
protectedBranches: [ protectedBranches: [
{ {
id: 1, id: 1,
name: 'master', name: 'main',
}, },
{ {
id: 2, id: 2,
...@@ -45,7 +45,7 @@ describe('Rule Branches', () => { ...@@ -45,7 +45,7 @@ describe('Rule Branches', () => {
rule, rule,
}); });
expect(wrapper.text()).toContain('master'); expect(wrapper.text()).toContain('main');
expect(wrapper.text()).not.toContain('hello'); expect(wrapper.text()).not.toContain('hello');
}); });
}); });
...@@ -7,9 +7,9 @@ describe('Approval MR edit module actions', () => { ...@@ -7,9 +7,9 @@ describe('Approval MR edit module actions', () => {
it('commits SET_TARGET_BRANCH', (done) => { it('commits SET_TARGET_BRANCH', (done) => {
testAction( testAction(
actions.setTargetBranch, actions.setTargetBranch,
'master', 'main',
{}, {},
[{ type: types.SET_TARGET_BRANCH, payload: 'master' }], [{ type: types.SET_TARGET_BRANCH, payload: 'main' }],
[], [],
done, done,
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment