Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cde8f588
Commit
cde8f588
authored
Apr 08, 2021
by
jerasmus
Committed by
Brandon Labuschagne
Apr 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update initial branch name in commit specs
Updated the initial branch name from master to main
parent
fb551ba2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
spec/frontend/projects/commit/components/branches_dropdown_spec.js
...tend/projects/commit/components/branches_dropdown_spec.js
+3
-3
spec/frontend/projects/commit/mock_data.js
spec/frontend/projects/commit/mock_data.js
+1
-1
spec/frontend/projects/commit/store/mutations_spec.js
spec/frontend/projects/commit/store/mutations_spec.js
+3
-3
spec/frontend/projects/commit_box/info/load_branches_spec.js
spec/frontend/projects/commit_box/info/load_branches_spec.js
+3
-3
No files found.
spec/frontend/projects/commit/components/branches_dropdown_spec.js
View file @
cde8f588
...
@@ -15,7 +15,7 @@ describe('BranchesDropdown', () => {
...
@@ -15,7 +15,7 @@ describe('BranchesDropdown', () => {
const
createComponent
=
(
term
,
state
=
{
isFetching
:
false
})
=>
{
const
createComponent
=
(
term
,
state
=
{
isFetching
:
false
})
=>
{
store
=
new
Vuex
.
Store
({
store
=
new
Vuex
.
Store
({
getters
:
{
getters
:
{
joinedBranches
:
()
=>
[
'
_ma
ster
_
'
,
'
_branch_1_
'
,
'
_branch_2_
'
],
joinedBranches
:
()
=>
[
'
_ma
in
_
'
,
'
_branch_1_
'
,
'
_branch_2_
'
],
},
},
actions
:
{
actions
:
{
fetchBranches
:
spyFetchBranches
,
fetchBranches
:
spyFetchBranches
,
...
@@ -94,13 +94,13 @@ describe('BranchesDropdown', () => {
...
@@ -94,13 +94,13 @@ describe('BranchesDropdown', () => {
it
(
'
renders all branches when search term is empty
'
,
()
=>
{
it
(
'
renders all branches when search term is empty
'
,
()
=>
{
expect
(
findAllDropdownItems
()).
toHaveLength
(
3
);
expect
(
findAllDropdownItems
()).
toHaveLength
(
3
);
expect
(
findDropdownItemByIndex
(
0
).
text
()).
toBe
(
'
_ma
ster
_
'
);
expect
(
findDropdownItemByIndex
(
0
).
text
()).
toBe
(
'
_ma
in
_
'
);
expect
(
findDropdownItemByIndex
(
1
).
text
()).
toBe
(
'
_branch_1_
'
);
expect
(
findDropdownItemByIndex
(
1
).
text
()).
toBe
(
'
_branch_1_
'
);
expect
(
findDropdownItemByIndex
(
2
).
text
()).
toBe
(
'
_branch_2_
'
);
expect
(
findDropdownItemByIndex
(
2
).
text
()).
toBe
(
'
_branch_2_
'
);
});
});
it
(
'
should not be selected on the inactive branch
'
,
()
=>
{
it
(
'
should not be selected on the inactive branch
'
,
()
=>
{
expect
(
wrapper
.
vm
.
isSelected
(
'
_ma
ster
_
'
)).
toBe
(
false
);
expect
(
wrapper
.
vm
.
isSelected
(
'
_ma
in
_
'
)).
toBe
(
false
);
});
});
});
});
...
...
spec/frontend/projects/commit/mock_data.js
View file @
cde8f588
...
@@ -23,6 +23,6 @@ export default {
...
@@ -23,6 +23,6 @@ export default {
modalId
:
'
_modal_id_
'
,
modalId
:
'
_modal_id_
'
,
openModal
:
'
_open_modal_
'
,
openModal
:
'
_open_modal_
'
,
},
},
mockBranches
:
[
'
_branch_1
'
,
'
_abc_
'
,
'
_ma
ster
_
'
],
mockBranches
:
[
'
_branch_1
'
,
'
_abc_
'
,
'
_ma
in
_
'
],
mockProjects
:
[
'
_project_1
'
,
'
_abc_
'
,
'
_project_
'
],
mockProjects
:
[
'
_project_1
'
,
'
_abc_
'
,
'
_project_
'
],
};
};
spec/frontend/projects/commit/store/mutations_spec.js
View file @
cde8f588
...
@@ -27,7 +27,7 @@ describe('Commit form modal mutations', () => {
...
@@ -27,7 +27,7 @@ describe('Commit form modal mutations', () => {
describe
(
'
CLEAR_MODAL
'
,
()
=>
{
describe
(
'
CLEAR_MODAL
'
,
()
=>
{
it
(
'
should clear modal state
'
,
()
=>
{
it
(
'
should clear modal state
'
,
()
=>
{
stateCopy
=
{
branch
:
'
_ma
ster
_
'
,
defaultBranch
:
'
_default_branch_
'
};
stateCopy
=
{
branch
:
'
_ma
in
_
'
,
defaultBranch
:
'
_default_branch_
'
};
mutations
[
types
.
CLEAR_MODAL
](
stateCopy
);
mutations
[
types
.
CLEAR_MODAL
](
stateCopy
);
...
@@ -47,7 +47,7 @@ describe('Commit form modal mutations', () => {
...
@@ -47,7 +47,7 @@ describe('Commit form modal mutations', () => {
describe
(
'
SET_BRANCH
'
,
()
=>
{
describe
(
'
SET_BRANCH
'
,
()
=>
{
it
(
'
should set branch
'
,
()
=>
{
it
(
'
should set branch
'
,
()
=>
{
stateCopy
=
{
branch
:
'
_ma
ster
_
'
};
stateCopy
=
{
branch
:
'
_ma
in
_
'
};
mutations
[
types
.
SET_BRANCH
](
stateCopy
,
'
_changed_branch_
'
);
mutations
[
types
.
SET_BRANCH
](
stateCopy
,
'
_changed_branch_
'
);
...
@@ -57,7 +57,7 @@ describe('Commit form modal mutations', () => {
...
@@ -57,7 +57,7 @@ describe('Commit form modal mutations', () => {
describe
(
'
SET_SELECTED_BRANCH
'
,
()
=>
{
describe
(
'
SET_SELECTED_BRANCH
'
,
()
=>
{
it
(
'
should set selectedBranch
'
,
()
=>
{
it
(
'
should set selectedBranch
'
,
()
=>
{
stateCopy
=
{
selectedBranch
:
'
_ma
ster
_
'
};
stateCopy
=
{
selectedBranch
:
'
_ma
in
_
'
};
mutations
[
types
.
SET_SELECTED_BRANCH
](
stateCopy
,
'
_changed_branch_
'
);
mutations
[
types
.
SET_SELECTED_BRANCH
](
stateCopy
,
'
_changed_branch_
'
);
...
...
spec/frontend/projects/commit_box/info/load_branches_spec.js
View file @
cde8f588
...
@@ -6,7 +6,7 @@ import { loadBranches } from '~/projects/commit_box/info/load_branches';
...
@@ -6,7 +6,7 @@ import { loadBranches } from '~/projects/commit_box/info/load_branches';
const
mockCommitPath
=
'
/commit/abcd/branches
'
;
const
mockCommitPath
=
'
/commit/abcd/branches
'
;
const
mockBranchesRes
=
const
mockBranchesRes
=
'
<a href="/-/commits/ma
ster">master
</a><span><a href="/-/commits/my-branch">my-branch</a></span>
'
;
'
<a href="/-/commits/ma
in">main
</a><span><a href="/-/commits/my-branch">my-branch</a></span>
'
;
describe
(
'
~/projects/commit_box/info/load_branches
'
,
()
=>
{
describe
(
'
~/projects/commit_box/info/load_branches
'
,
()
=>
{
let
mock
;
let
mock
;
...
@@ -45,7 +45,7 @@ describe('~/projects/commit_box/info/load_branches', () => {
...
@@ -45,7 +45,7 @@ describe('~/projects/commit_box/info/load_branches', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
mock
mock
.
onGet
(
mockCommitPath
)
.
onGet
(
mockCommitPath
)
.
reply
(
200
,
'
<a onload="alert(
\'
xss!
\'
);" href="/-/commits/ma
ster">master
</a>
'
);
.
reply
(
200
,
'
<a onload="alert(
\'
xss!
\'
);" href="/-/commits/ma
in">main
</a>
'
);
});
});
it
(
'
displays sanitized html
'
,
async
()
=>
{
it
(
'
displays sanitized html
'
,
async
()
=>
{
...
@@ -53,7 +53,7 @@ describe('~/projects/commit_box/info/load_branches', () => {
...
@@ -53,7 +53,7 @@ describe('~/projects/commit_box/info/load_branches', () => {
await
waitForPromises
();
await
waitForPromises
();
expect
(
getElInnerHtml
()).
toMatchInterpolatedText
(
expect
(
getElInnerHtml
()).
toMatchInterpolatedText
(
'
<div class="commit-info branches"><a href="/-/commits/ma
ster">master
</a></div>
'
,
'
<div class="commit-info branches"><a href="/-/commits/ma
in">main
</a></div>
'
,
);
);
});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment