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
f6325145
Commit
f6325145
authored
Apr 09, 2021
by
jboyson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests to account for broken scenario
parent
3a3f6778
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
spec/frontend/vue_mr_widget/components/states/mr_widget_auto_merge_enabled_spec.js
...et/components/states/mr_widget_auto_merge_enabled_spec.js
+26
-3
No files found.
spec/frontend/vue_mr_widget/components/states/mr_widget_auto_merge_enabled_spec.js
View file @
f6325145
...
...
@@ -28,11 +28,11 @@ function convertPropsToGraphqlState(props) {
};
}
function
factory
(
propsData
)
{
function
factory
(
propsData
,
stateOverride
=
{}
)
{
let
state
=
{};
if
(
mergeRequestWidgetGraphqlEnabled
)
{
state
=
convertPropsToGraphqlState
(
propsData
)
;
state
=
{
...
convertPropsToGraphqlState
(
propsData
),
...
stateOverride
}
;
}
wrapper
=
extendedWrapper
(
...
...
@@ -125,7 +125,7 @@ describe('MRWidgetAutoMergeEnabled', () => {
},
);
it
(
'
should
return false when shouldRemoveSourceBranch set to fals
e
'
,
()
=>
{
it
(
'
should
not find "Delete" button when shouldRemoveSourceBranch set to tru
e
'
,
()
=>
{
factory
({
...
defaultMrProps
(),
shouldRemoveSourceBranch
:
true
,
...
...
@@ -134,6 +134,29 @@ describe('MRWidgetAutoMergeEnabled', () => {
expect
(
wrapper
.
findByTestId
(
'
removeSourceBranchButton
'
).
exists
()).
toBe
(
false
);
});
it
(
'
should find "Delete" button when shouldRemoveSourceBranch overrides state.forceRemoveSourceBranch
'
,
()
=>
{
factory
(
{
...
defaultMrProps
(),
shouldRemoveSourceBranch
:
false
,
},
{
forceRemoveSourceBranch
:
true
,
},
);
expect
(
wrapper
.
findByTestId
(
'
removeSourceBranchButton
'
).
exists
()).
toBe
(
true
);
});
it
(
'
should find "Delete" button when shouldRemoveSourceBranch set to false
'
,
()
=>
{
factory
({
...
defaultMrProps
(),
shouldRemoveSourceBranch
:
false
,
});
expect
(
wrapper
.
findByTestId
(
'
removeSourceBranchButton
'
).
exists
()).
toBe
(
true
);
});
it
(
'
should return false if user is not able to remove the source branch
'
,
()
=>
{
factory
({
...
defaultMrProps
(),
...
...
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