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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
dbc15448
Commit
dbc15448
authored
Jul 16, 2019
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed create merge request button not enabling
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/64454
parent
c29da98f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
1 deletion
+35
-1
app/assets/javascripts/create_merge_request_dropdown.js
app/assets/javascripts/create_merge_request_dropdown.js
+1
-1
spec/frontend/create_merge_request_dropdown_spec.js
spec/frontend/create_merge_request_dropdown_spec.js
+34
-0
No files found.
app/assets/javascripts/create_merge_request_dropdown.js
View file @
dbc15448
...
...
@@ -182,7 +182,7 @@ export default class CreateMergeRequestDropdown {
}
enable
()
{
if
(
!
canCreateConfidentialMergeRequest
())
return
;
if
(
isConfidentialIssue
()
&&
!
canCreateConfidentialMergeRequest
())
return
;
this
.
createMergeRequestButton
.
classList
.
remove
(
'
disabled
'
);
this
.
createMergeRequestButton
.
removeAttribute
(
'
disabled
'
);
...
...
spec/frontend/create_merge_request_dropdown_spec.js
View file @
dbc15448
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
CreateMergeRequestDropdown
from
'
~/create_merge_request_dropdown
'
;
import
confidentialState
from
'
~/confidential_merge_request/state
'
;
import
{
TEST_HOST
}
from
'
./helpers/test_constants
'
;
describe
(
'
CreateMergeRequestDropdown
'
,
()
=>
{
...
...
@@ -66,4 +67,37 @@ describe('CreateMergeRequestDropdown', () => {
);
});
});
describe
(
'
enable
'
,
()
=>
{
beforeEach
(()
=>
{
dropdown
.
createMergeRequestButton
.
classList
.
add
(
'
disabled
'
);
});
afterEach
(()
=>
{
confidentialState
.
selectedProject
=
{};
});
it
(
'
enables button when not confidential issue
'
,
()
=>
{
dropdown
.
enable
();
expect
(
dropdown
.
createMergeRequestButton
.
classList
).
not
.
toContain
(
'
disabled
'
);
});
it
(
'
enables when can create confidential issue
'
,
()
=>
{
document
.
querySelector
(
'
.js-create-mr
'
).
setAttribute
(
'
data-is-confidential
'
,
'
true
'
);
confidentialState
.
selectedProject
=
{
name
:
'
test
'
};
dropdown
.
enable
();
expect
(
dropdown
.
createMergeRequestButton
.
classList
).
not
.
toContain
(
'
disabled
'
);
});
it
(
'
does not enable when can not create confidential issue
'
,
()
=>
{
document
.
querySelector
(
'
.js-create-mr
'
).
setAttribute
(
'
data-is-confidential
'
,
'
true
'
);
dropdown
.
enable
();
expect
(
dropdown
.
createMergeRequestButton
.
classList
).
toContain
(
'
disabled
'
);
});
});
});
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