Commit 02c91aec authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch '327686-update-mr-widget-specs' into 'master'

Update default branch name in mr_widget specs

See merge request gitlab-org/gitlab!59860
parents 0927b183 1b99e5bf
......@@ -49,7 +49,7 @@ describe('ReadyToMerge', () => {
commitMessageWithDescription: 'This is the commit message description',
shouldRemoveSourceBranch: true,
canRemoveSourceBranch: false,
targetBranch: 'master',
targetBranch: 'main',
preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY,
availableAutoMergeStrategies: [MWPS_MERGE_STRATEGY],
mergeImmediatelyDocsPath: 'path/to/merge/immediately/docs',
......
......@@ -34,7 +34,7 @@ describe('MRWidgetHeader', () => {
divergedCommitsCount: 12,
sourceBranch: 'mr-widget-refactor',
sourceBranchLink: '<a href="/foo/bar/mr-widget-refactor">Link</a>',
targetBranch: 'master',
targetBranch: 'main',
statusPath: 'abc',
},
});
......@@ -48,7 +48,7 @@ describe('MRWidgetHeader', () => {
divergedCommitsCount: 0,
sourceBranch: 'mr-widget-refactor',
sourceBranchLink: '<a href="/foo/bar/mr-widget-refactor">Link</a>',
targetBranch: 'master',
targetBranch: 'main',
statusPath: 'abc',
},
});
......@@ -64,14 +64,14 @@ describe('MRWidgetHeader', () => {
divergedCommitsCount: 1,
sourceBranch: 'mr-widget-refactor',
sourceBranchLink: '<a href="/foo/bar/mr-widget-refactor">Link</a>',
targetBranch: 'master',
targetBranchPath: '/foo/bar/master',
targetBranch: 'main',
targetBranchPath: '/foo/bar/main',
statusPath: 'abc',
},
});
expect(wrapper.vm.commitsBehindText).toBe(
'The source branch is <a href="/foo/bar/master">1 commit behind</a> the target branch',
'The source branch is <a href="/foo/bar/main">1 commit behind</a> the target branch',
);
});
......@@ -81,14 +81,14 @@ describe('MRWidgetHeader', () => {
divergedCommitsCount: 2,
sourceBranch: 'mr-widget-refactor',
sourceBranchLink: '<a href="/foo/bar/mr-widget-refactor">Link</a>',
targetBranch: 'master',
targetBranchPath: '/foo/bar/master',
targetBranch: 'main',
targetBranchPath: '/foo/bar/main',
statusPath: 'abc',
},
});
expect(wrapper.vm.commitsBehindText).toBe(
'The source branch is <a href="/foo/bar/master">2 commits behind</a> the target branch',
'The source branch is <a href="/foo/bar/main">2 commits behind</a> the target branch',
);
});
});
......@@ -105,7 +105,7 @@ describe('MRWidgetHeader', () => {
sourceBranchRemoved: false,
targetBranchPath: 'foo/bar/commits-path',
targetBranchTreePath: 'foo/bar/tree/path',
targetBranch: 'master',
targetBranch: 'main',
isOpen: true,
emailPatchesPath: '/mr/email-patches',
plainDiffPath: '/mr/plainDiffPath',
......@@ -125,7 +125,7 @@ describe('MRWidgetHeader', () => {
});
it('renders target branch', () => {
expect(wrapper.find('.js-target-branch').text().trim()).toBe('master');
expect(wrapper.find('.js-target-branch').text().trim()).toBe('main');
});
});
......@@ -138,7 +138,7 @@ describe('MRWidgetHeader', () => {
sourceBranchRemoved: false,
targetBranchPath: 'foo/bar/commits-path',
targetBranchTreePath: 'foo/bar/tree/path',
targetBranch: 'master',
targetBranch: 'main',
isOpen: true,
canPushToSourceBranch: true,
emailPatchesPath: '/mr/email-patches',
......@@ -227,7 +227,7 @@ describe('MRWidgetHeader', () => {
sourceBranchRemoved: false,
targetBranchPath: 'foo/bar/commits-path',
targetBranchTreePath: 'foo/bar/tree/path',
targetBranch: 'master',
targetBranch: 'main',
isOpen: false,
emailPatchesPath: '/mr/email-patches',
plainDiffPath: '/mr/plainDiffPath',
......@@ -257,7 +257,7 @@ describe('MRWidgetHeader', () => {
sourceBranchRemoved: false,
targetBranchPath: 'foo/bar/commits-path',
targetBranchTreePath: 'foo/bar/tree/path',
targetBranch: 'master',
targetBranch: 'main',
isOpen: true,
emailPatchesPath: '/mr/email-patches',
plainDiffPath: '/mr/plainDiffPath',
......@@ -281,7 +281,7 @@ describe('MRWidgetHeader', () => {
sourceBranchRemoved: false,
targetBranchPath: 'foo/bar/commits-path',
targetBranchTreePath: 'foo/bar/tree/path',
targetBranch: 'master',
targetBranch: 'main',
isOpen: true,
emailPatchesPath: '/mr/email-patches',
plainDiffPath: '/mr/plainDiffPath',
......
......@@ -8,7 +8,7 @@ describe('Commits header component', () => {
wrapper = shallowMount(CommitsHeader, {
propsData: {
isSquashEnabled: false,
targetBranch: 'master',
targetBranch: 'main',
commitsCount: 5,
isFastForwardEnabled: false,
...props,
......@@ -94,7 +94,7 @@ describe('Commits header component', () => {
it('has correct target branch displayed', () => {
createComponent();
expect(findTargetBranchMessage().text()).toBe('master');
expect(findTargetBranchMessage().text()).toBe('main');
});
it('does has merge commit part of the message', () => {
......
......@@ -42,7 +42,7 @@ const createTestMr = (customConfig) => {
commitMessageWithDescription,
shouldRemoveSourceBranch: true,
canRemoveSourceBranch: false,
targetBranch: 'master',
targetBranch: 'main',
preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY,
availableAutoMergeStrategies: [MWPS_MERGE_STRATEGY],
mergeImmediatelyDocsPath: 'path/to/merge/immediately/docs',
......
......@@ -45,15 +45,15 @@ const deploymentMockData = {
changes: [
{
path: 'index.html',
external_url: 'http://root-master-patch-91341.volatile-watch.surge.sh/index.html',
external_url: 'http://root-main-patch-91341.volatile-watch.surge.sh/index.html',
},
{
path: 'imgs/gallery.html',
external_url: 'http://root-master-patch-91341.volatile-watch.surge.sh/imgs/gallery.html',
external_url: 'http://root-main-patch-91341.volatile-watch.surge.sh/imgs/gallery.html',
},
{
path: 'about/',
external_url: 'http://root-master-patch-91341.volatile-watch.surge.sh/about/',
external_url: 'http://root-main-patch-91341.volatile-watch.surge.sh/about/',
},
],
};
......
......@@ -48,7 +48,7 @@ export default {
source_branch_link: 'daaaa',
source_project_id: 19,
source_project_full_path: '/group1/project1',
target_branch: 'master',
target_branch: 'main',
target_project_id: 19,
target_project_full_path: '/group2/project2',
merge_request_add_ci_config_path: '/group2/project2/new/pipeline',
......@@ -83,7 +83,7 @@ export default {
diff_head_sha: '104096c51715e12e7ae41f9333e9fa35b73f385d',
diff_head_commit_short_id: '104096c5',
default_merge_commit_message:
"Merge branch 'daaaa' into 'master'\n\nUpdate README.md\n\nSee merge request !22",
"Merge branch 'daaaa' into 'main'\n\nUpdate README.md\n\nSee merge request !22",
pipeline: {
id: 172,
user: {
......@@ -173,8 +173,8 @@ export default {
title: 'Update README.md',
source_branch: 'feature-1',
source_branch_path: '/root/detached-merge-request-pipelines/branches/feature-1',
target_branch: 'master',
target_branch_path: '/root/detached-merge-request-pipelines/branches/master',
target_branch: 'main',
target_branch_path: '/root/detached-merge-request-pipelines/branches/main',
},
commit: {
id: '104096c51715e12e7ae41f9333e9fa35b73f385d',
......@@ -243,7 +243,7 @@ export default {
head_path: 'blob_path',
},
codequality_help_path: 'code_quality.html',
target_branch_path: '/root/acets-app/branches/master',
target_branch_path: '/root/acets-app/branches/main',
source_branch_path: '/root/acets-app/branches/daaaa',
conflict_resolution_ui_path: '/root/acets-app/-/merge_requests/22/conflicts',
remove_wip_path: '/root/acets-app/-/merge_requests/22/remove_wip',
......@@ -264,7 +264,7 @@ export default {
ci_environments_status_url: '/root/acets-app/-/merge_requests/22/ci_environments_status',
project_archived: false,
default_merge_commit_message_with_description:
"Merge branch 'daaaa' into 'master'\n\nUpdate README.md\n\nSee merge request !22",
"Merge branch 'daaaa' into 'main'\n\nUpdate README.md\n\nSee merge request !22",
default_squash_commit_message: 'Test squash commit message',
diverged_commits_count: 0,
only_allow_merge_if_pipeline_succeeds: false,
......
......@@ -559,15 +559,15 @@ describe('MrWidgetOptions', () => {
const changes = [
{
path: 'index.html',
external_url: 'http://root-master-patch-91341.volatile-watch.surge.sh/index.html',
external_url: 'http://root-main-patch-91341.volatile-watch.surge.sh/index.html',
},
{
path: 'imgs/gallery.html',
external_url: 'http://root-master-patch-91341.volatile-watch.surge.sh/imgs/gallery.html',
external_url: 'http://root-main-patch-91341.volatile-watch.surge.sh/imgs/gallery.html',
},
{
path: 'about/',
external_url: 'http://root-master-patch-91341.volatile-watch.surge.sh/about/',
external_url: 'http://root-main-patch-91341.volatile-watch.surge.sh/about/',
},
];
const deploymentMockData = {
......@@ -688,22 +688,22 @@ describe('MrWidgetOptions', () => {
scheduled_actions: [],
},
ref: {
name: 'master',
path: '/root/ci-web-terminal/commits/master',
name: 'main',
path: '/root/ci-web-terminal/commits/main',
tag: false,
branch: true,
},
commit: {
id: 'aa1939133d373c94879becb79d91828a892ee319',
short_id: 'aa193913',
title: "Merge branch 'master-test' into 'master'",
title: "Merge branch 'main-test' into 'main'",
created_at: '2018-10-22T11:41:33.000Z',
parent_ids: [
'4622f4dd792468993003caf2e3be978798cbe096',
'76598df914cdfe87132d0c3c40f80db9fa9396a4',
],
message:
"Merge branch 'master-test' into 'master'\n\nUpdate .gitlab-ci.yml\n\nSee merge request root/ci-web-terminal!1",
"Merge branch 'main-test' into 'main'\n\nUpdate .gitlab-ci.yml\n\nSee merge request root/ci-web-terminal!1",
author_name: 'Administrator',
author_email: 'admin@example.com',
authored_date: '2018-10-22T11:41:33.000Z',
......@@ -751,17 +751,16 @@ describe('MrWidgetOptions', () => {
changes: [
{
path: 'index.html',
external_url:
'http://root-master-patch-91341.volatile-watch.surge.sh/index.html',
external_url: 'http://root-main-patch-91341.volatile-watch.surge.sh/index.html',
},
{
path: 'imgs/gallery.html',
external_url:
'http://root-master-patch-91341.volatile-watch.surge.sh/imgs/gallery.html',
'http://root-main-patch-91341.volatile-watch.surge.sh/imgs/gallery.html',
},
{
path: 'about/',
external_url: 'http://root-master-patch-91341.volatile-watch.surge.sh/about/',
external_url: 'http://root-main-patch-91341.volatile-watch.surge.sh/about/',
},
],
status: 'success',
......
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