Commit 12393cb8 authored by Miguel Rincon's avatar Miguel Rincon

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

Update default branch name in pipelines specs

See merge request gitlab-org/gitlab!59853
parents c186df87 9af97a34
...@@ -17,7 +17,7 @@ const projectRefsEndpoint = '/root/project/refs'; ...@@ -17,7 +17,7 @@ const projectRefsEndpoint = '/root/project/refs';
const pipelinesPath = '/root/project/-/pipelines'; const pipelinesPath = '/root/project/-/pipelines';
const configVariablesPath = '/root/project/-/pipelines/config_variables'; const configVariablesPath = '/root/project/-/pipelines/config_variables';
const newPipelinePostResponse = { id: 1 }; const newPipelinePostResponse = { id: 1 };
const defaultBranch = 'master'; const defaultBranch = 'main';
describe('Pipeline New Form', () => { describe('Pipeline New Form', () => {
let wrapper; let wrapper;
...@@ -187,13 +187,13 @@ describe('Pipeline New Form', () => { ...@@ -187,13 +187,13 @@ describe('Pipeline New Form', () => {
await waitForPromises(); await waitForPromises();
}); });
it('variables persist between ref changes', async () => { it('variables persist between ref changes', async () => {
selectBranch('master'); selectBranch('main');
await waitForPromises(); await waitForPromises();
const masterInput = findKeyInputs().at(0); const mainInput = findKeyInputs().at(0);
masterInput.element.value = 'build_var'; mainInput.element.value = 'build_var';
masterInput.trigger('change'); mainInput.trigger('change');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
...@@ -207,7 +207,7 @@ describe('Pipeline New Form', () => { ...@@ -207,7 +207,7 @@ describe('Pipeline New Form', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
selectBranch('master'); selectBranch('main');
await waitForPromises(); await waitForPromises();
......
...@@ -10,8 +10,8 @@ import RefsDropdown from '~/pipeline_new/components/refs_dropdown.vue'; ...@@ -10,8 +10,8 @@ import RefsDropdown from '~/pipeline_new/components/refs_dropdown.vue';
import { mockRefs, mockFilteredRefs } from '../mock_data'; import { mockRefs, mockFilteredRefs } from '../mock_data';
const projectRefsEndpoint = '/root/project/refs'; const projectRefsEndpoint = '/root/project/refs';
const refShortName = 'master'; const refShortName = 'main';
const refFullName = 'refs/heads/master'; const refFullName = 'refs/heads/main';
jest.mock('~/flash'); jest.mock('~/flash');
......
export const mockRefs = { export const mockRefs = {
Branches: ['master', 'branch-1', 'branch-2'], Branches: ['main', 'branch-1', 'branch-2'],
Tags: ['1.0.0', '1.1.0', '1.2.0'], Tags: ['1.0.0', '1.1.0', '1.2.0'],
}; };
...@@ -40,6 +40,6 @@ export const mockError = { ...@@ -40,6 +40,6 @@ export const mockError = {
total_warnings: 7, total_warnings: 7,
}; };
export const mockBranchRefs = ['master', 'dev', 'release']; export const mockBranchRefs = ['main', 'dev', 'release'];
export const mockTagRefs = ['1.0.0', '1.1.0', '1.2.0']; export const mockTagRefs = ['1.0.0', '1.1.0', '1.2.0'];
...@@ -5,7 +5,7 @@ import { mockBranchRefs, mockTagRefs } from '../mock_data'; ...@@ -5,7 +5,7 @@ import { mockBranchRefs, mockTagRefs } from '../mock_data';
describe('Format refs util', () => { describe('Format refs util', () => {
it('formats branch ref correctly', () => { it('formats branch ref correctly', () => {
expect(formatRefs(mockBranchRefs, BRANCH_REF_TYPE)).toEqual([ expect(formatRefs(mockBranchRefs, BRANCH_REF_TYPE)).toEqual([
{ fullName: 'refs/heads/master', shortName: 'master' }, { fullName: 'refs/heads/main', shortName: 'main' },
{ fullName: 'refs/heads/dev', shortName: 'dev' }, { fullName: 'refs/heads/dev', shortName: 'dev' },
{ fullName: 'refs/heads/release', shortName: 'release' }, { fullName: 'refs/heads/release', shortName: 'release' },
]); ]);
......
...@@ -138,7 +138,7 @@ describe('Pipelines filtered search', () => { ...@@ -138,7 +138,7 @@ describe('Pipelines filtered search', () => {
describe('Url query params', () => { describe('Url query params', () => {
const params = { const params = {
username: 'deja.green', username: 'deja.green',
ref: 'master', ref: 'main',
}; };
beforeEach(() => { beforeEach(() => {
......
...@@ -3727,8 +3727,8 @@ export default { ...@@ -3727,8 +3727,8 @@ export default {
scheduled_actions: [], scheduled_actions: [],
}, },
ref: { ref: {
name: 'master', name: 'main',
path: '/h5bp/html5-boilerplate/commits/master', path: '/h5bp/html5-boilerplate/commits/main',
tag: false, tag: false,
branch: true, branch: true,
merge_request: false, merge_request: false,
......
...@@ -221,22 +221,22 @@ export default { ...@@ -221,22 +221,22 @@ export default {
cancelable: false, cancelable: false,
}, },
ref: { ref: {
name: 'master', name: 'main',
path: '/root/ci-mock/tree/master', path: '/root/ci-mock/tree/main',
tag: false, tag: false,
branch: true, branch: true,
}, },
commit: { commit: {
id: '798e5f902592192afaba73f4668ae30e56eae492', id: '798e5f902592192afaba73f4668ae30e56eae492',
short_id: '798e5f90', short_id: '798e5f90',
title: "Merge branch 'new-branch' into 'master'\r", title: "Merge branch 'new-branch' into 'main'\r",
created_at: '2017-04-13T10:25:17.000+01:00', created_at: '2017-04-13T10:25:17.000+01:00',
parent_ids: [ parent_ids: [
'54d483b1ed156fbbf618886ddf7ab023e24f8738', '54d483b1ed156fbbf618886ddf7ab023e24f8738',
'c8e2d38a6c538822e81c57022a6e3a0cfedebbcc', 'c8e2d38a6c538822e81c57022a6e3a0cfedebbcc',
], ],
message: message:
"Merge branch 'new-branch' into 'master'\r\n\r\nAdd new file\r\n\r\nSee merge request !1", "Merge branch 'new-branch' into 'main'\r\n\r\nAdd new file\r\n\r\nSee merge request !1",
author_name: 'Root', author_name: 'Root',
author_email: 'admin@example.com', author_email: 'admin@example.com',
authored_date: '2017-04-13T10:25:17.000+01:00', authored_date: '2017-04-13T10:25:17.000+01:00',
......
...@@ -387,7 +387,7 @@ export const tags = [ ...@@ -387,7 +387,7 @@ export const tags = [
protected: false, protected: false,
}, },
{ {
name: 'master-tag', name: 'main-tag',
message: '', message: '',
target: '66673b07efef254dab7d537f0433a40e61cf84fe', target: '66673b07efef254dab7d537f0433a40e61cf84fe',
commit: { commit: {
...@@ -413,10 +413,10 @@ export const tags = [ ...@@ -413,10 +413,10 @@ export const tags = [
export const mockSearch = [ export const mockSearch = [
{ type: 'username', value: { data: 'root', operator: '=' } }, { type: 'username', value: { data: 'root', operator: '=' } },
{ type: 'ref', value: { data: 'master', operator: '=' } }, { type: 'ref', value: { data: 'main', operator: '=' } },
{ type: 'status', value: { data: 'pending', operator: '=' } }, { type: 'status', value: { data: 'pending', operator: '=' } },
]; ];
export const mockBranchesAfterMap = ['branch-1', 'branch-10', 'branch-11']; export const mockBranchesAfterMap = ['branch-1', 'branch-10', 'branch-11'];
export const mockTagsAfterMap = ['tag-3', 'tag-2', 'tag-1', 'master-tag']; export const mockTagsAfterMap = ['tag-3', 'tag-2', 'tag-1', 'main-tag'];
...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
import ExperimentTracking from '~/experimentation/experiment_tracking'; import ExperimentTracking from '~/experimentation/experiment_tracking';
import PipelinesCiTemplate from '~/pipelines/components/pipelines_list/pipelines_ci_templates.vue'; import PipelinesCiTemplate from '~/pipelines/components/pipelines_list/pipelines_ci_templates.vue';
const addCiYmlPath = "/-/new/master?commit_message='Add%20.gitlab-ci.yml'"; const addCiYmlPath = "/-/new/main?commit_message='Add%20.gitlab-ci.yml'";
const suggestedCiTemplates = [ const suggestedCiTemplates = [
{ name: 'Android', logo: '/assets/illustrations/logos/android.svg' }, { name: 'Android', logo: '/assets/illustrations/logos/android.svg' },
{ name: 'Bash', logo: '/assets/illustrations/logos/bash.svg' }, { name: 'Bash', logo: '/assets/illustrations/logos/bash.svg' },
......
...@@ -289,7 +289,7 @@ describe('Pipelines', () => { ...@@ -289,7 +289,7 @@ describe('Pipelines', () => {
page: '1', page: '1',
scope: 'all', scope: 'all',
username: 'root', username: 'root',
ref: 'master', ref: 'main',
status: 'pending', status: 'pending',
}; };
...@@ -321,7 +321,7 @@ describe('Pipelines', () => { ...@@ -321,7 +321,7 @@ describe('Pipelines', () => {
expect(window.history.pushState).toHaveBeenCalledWith( expect(window.history.pushState).toHaveBeenCalledWith(
expect.anything(), expect.anything(),
expect.anything(), expect.anything(),
`${window.location.pathname}?page=1&scope=all&username=root&ref=master&status=pending`, `${window.location.pathname}?page=1&scope=all&username=root&ref=main&status=pending`,
); );
}); });
}); });
......
...@@ -13,7 +13,7 @@ describe('Test case details', () => { ...@@ -13,7 +13,7 @@ describe('Test case details', () => {
formattedTime: '10.04ms', formattedTime: '10.04ms',
recent_failures: { recent_failures: {
count: 2, count: 2,
base_branch: 'master', base_branch: 'main',
}, },
system_output: 'Line 42 is broken', system_output: 'Line 42 is broken',
}; };
......
...@@ -89,7 +89,7 @@ describe('Pipeline Branch Name Token', () => { ...@@ -89,7 +89,7 @@ describe('Pipeline Branch Name Token', () => {
}); });
it('renders only the branch searched for', () => { it('renders only the branch searched for', () => {
const mockBranches = ['master']; const mockBranches = ['main'];
createComponent({ stubs }, { branches: mockBranches, loading: false }); createComponent({ stubs }, { branches: mockBranches, loading: false });
expect(findAllFilteredSearchSuggestions()).toHaveLength(mockBranches.length); expect(findAllFilteredSearchSuggestions()).toHaveLength(mockBranches.length);
......
...@@ -89,7 +89,7 @@ describe('Pipeline Branch Name Token', () => { ...@@ -89,7 +89,7 @@ describe('Pipeline Branch Name Token', () => {
}); });
it('renders only the tag searched for', () => { it('renders only the tag searched for', () => {
const mockTags = ['master-tag']; const mockTags = ['main-tag'];
createComponent({ stubs }, { tags: mockTags, loading: false }); createComponent({ stubs }, { tags: mockTags, loading: false });
expect(findAllFilteredSearchSuggestions()).toHaveLength(mockTags.length); expect(findAllFilteredSearchSuggestions()).toHaveLength(mockTags.length);
......
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