Commit cde8f588 authored by jerasmus's avatar jerasmus Committed by Brandon Labuschagne

Update initial branch name in commit specs

Updated the initial branch name from master to main
parent fb551ba2
......@@ -15,7 +15,7 @@ describe('BranchesDropdown', () => {
const createComponent = (term, state = { isFetching: false }) => {
store = new Vuex.Store({
getters: {
joinedBranches: () => ['_master_', '_branch_1_', '_branch_2_'],
joinedBranches: () => ['_main_', '_branch_1_', '_branch_2_'],
},
actions: {
fetchBranches: spyFetchBranches,
......@@ -94,13 +94,13 @@ describe('BranchesDropdown', () => {
it('renders all branches when search term is empty', () => {
expect(findAllDropdownItems()).toHaveLength(3);
expect(findDropdownItemByIndex(0).text()).toBe('_master_');
expect(findDropdownItemByIndex(0).text()).toBe('_main_');
expect(findDropdownItemByIndex(1).text()).toBe('_branch_1_');
expect(findDropdownItemByIndex(2).text()).toBe('_branch_2_');
});
it('should not be selected on the inactive branch', () => {
expect(wrapper.vm.isSelected('_master_')).toBe(false);
expect(wrapper.vm.isSelected('_main_')).toBe(false);
});
});
......
......@@ -23,6 +23,6 @@ export default {
modalId: '_modal_id_',
openModal: '_open_modal_',
},
mockBranches: ['_branch_1', '_abc_', '_master_'],
mockBranches: ['_branch_1', '_abc_', '_main_'],
mockProjects: ['_project_1', '_abc_', '_project_'],
};
......@@ -27,7 +27,7 @@ describe('Commit form modal mutations', () => {
describe('CLEAR_MODAL', () => {
it('should clear modal state ', () => {
stateCopy = { branch: '_master_', defaultBranch: '_default_branch_' };
stateCopy = { branch: '_main_', defaultBranch: '_default_branch_' };
mutations[types.CLEAR_MODAL](stateCopy);
......@@ -47,7 +47,7 @@ describe('Commit form modal mutations', () => {
describe('SET_BRANCH', () => {
it('should set branch', () => {
stateCopy = { branch: '_master_' };
stateCopy = { branch: '_main_' };
mutations[types.SET_BRANCH](stateCopy, '_changed_branch_');
......@@ -57,7 +57,7 @@ describe('Commit form modal mutations', () => {
describe('SET_SELECTED_BRANCH', () => {
it('should set selectedBranch', () => {
stateCopy = { selectedBranch: '_master_' };
stateCopy = { selectedBranch: '_main_' };
mutations[types.SET_SELECTED_BRANCH](stateCopy, '_changed_branch_');
......
......@@ -6,7 +6,7 @@ import { loadBranches } from '~/projects/commit_box/info/load_branches';
const mockCommitPath = '/commit/abcd/branches';
const mockBranchesRes =
'<a href="/-/commits/master">master</a><span><a href="/-/commits/my-branch">my-branch</a></span>';
'<a href="/-/commits/main">main</a><span><a href="/-/commits/my-branch">my-branch</a></span>';
describe('~/projects/commit_box/info/load_branches', () => {
let mock;
......@@ -45,7 +45,7 @@ describe('~/projects/commit_box/info/load_branches', () => {
beforeEach(() => {
mock
.onGet(mockCommitPath)
.reply(200, '<a onload="alert(\'xss!\');" href="/-/commits/master">master</a>');
.reply(200, '<a onload="alert(\'xss!\');" href="/-/commits/main">main</a>');
});
it('displays sanitized html', async () => {
......@@ -53,7 +53,7 @@ describe('~/projects/commit_box/info/load_branches', () => {
await waitForPromises();
expect(getElInnerHtml()).toMatchInterpolatedText(
'<div class="commit-info branches"><a href="/-/commits/master">master</a></div>',
'<div class="commit-info branches"><a href="/-/commits/main">main</a></div>',
);
});
});
......
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