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
e0ed769c
Commit
e0ed769c
authored
May 31, 2021
by
jboyson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reference to `isSquashReadOnly`
Changelog: fixed
parent
7a406c41
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
...merge_request_widget/components/states/ready_to_merge.vue
+1
-1
spec/frontend/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js
...widget/components/states/mr_widget_ready_to_merge_spec.js
+34
-1
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
View file @
e0ed769c
...
@@ -191,7 +191,7 @@ export default {
...
@@ -191,7 +191,7 @@ export default {
},
},
squashIsSelected
()
{
squashIsSelected
()
{
if
(
this
.
glFeatures
.
mergeRequestWidgetGraphql
)
{
if
(
this
.
glFeatures
.
mergeRequestWidgetGraphql
)
{
return
this
.
s
quashReadOnly
?
this
.
state
.
squashOnMerge
:
this
.
state
.
squash
;
return
this
.
isS
quashReadOnly
?
this
.
state
.
squashOnMerge
:
this
.
state
.
squash
;
}
}
return
this
.
mr
.
squashIsSelected
;
return
this
.
mr
.
squashIsSelected
;
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js
View file @
e0ed769c
...
@@ -59,12 +59,17 @@ const createTestService = () => ({
...
@@ -59,12 +59,17 @@ const createTestService = () => ({
});
});
let
wrapper
;
let
wrapper
;
const
createComponent
=
(
customConfig
=
{})
=>
{
const
createComponent
=
(
customConfig
=
{}
,
mergeRequestWidgetGraphql
=
false
)
=>
{
wrapper
=
shallowMount
(
ReadyToMerge
,
{
wrapper
=
shallowMount
(
ReadyToMerge
,
{
propsData
:
{
propsData
:
{
mr
:
createTestMr
(
customConfig
),
mr
:
createTestMr
(
customConfig
),
service
:
createTestService
(),
service
:
createTestService
(),
},
},
provide
:
{
glFeatures
:
{
mergeRequestWidgetGraphql
,
},
},
});
});
};
};
...
@@ -673,6 +678,34 @@ describe('ReadyToMerge', () => {
...
@@ -673,6 +678,34 @@ describe('ReadyToMerge', () => {
expect
(
findCommitEditElements
().
length
).
toBe
(
2
);
expect
(
findCommitEditElements
().
length
).
toBe
(
2
);
});
});
it
(
'
should have two edit components when squash is enabled and there is more than 1 commit and mergeRequestWidgetGraphql is enabled
'
,
async
()
=>
{
createComponent
(
{
mr
:
{
commitsCount
:
2
,
squashIsSelected
:
true
,
enableSquashBeforeMerge
:
true
,
},
},
true
,
);
wrapper
.
setData
({
loading
:
false
,
state
:
{
...
createTestMr
({}),
userPermissions
:
{},
squash
:
true
,
mergeable
:
true
,
commitCount
:
2
,
commitsWithoutMergeCommits
:
{},
},
});
await
wrapper
.
vm
.
$nextTick
();
expect
(
findCommitEditElements
().
length
).
toBe
(
2
);
});
it
(
'
should have one edit components when squash is enabled and there is 1 commit only
'
,
()
=>
{
it
(
'
should have one edit components when squash is enabled and there is 1 commit only
'
,
()
=>
{
createComponent
({
createComponent
({
mr
:
{
mr
:
{
...
...
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