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
b9e40e1d
Commit
b9e40e1d
authored
Sep 24, 2021
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for changes in comment_type_dropdown event handlers
parent
0a761e5f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
spec/frontend/notes/components/comment_type_dropdown_spec.js
spec/frontend/notes/components/comment_type_dropdown_spec.js
+12
-2
No files found.
spec/frontend/notes/components/comment_type_dropdown_spec.js
View file @
b9e40e1d
...
...
@@ -47,8 +47,18 @@ describe('CommentTypeDropdown component', () => {
it
(
'
Should emit `change` event when clicking on an alternate dropdown option
'
,
()
=>
{
mountComponent
({
props
:
{
noteType
:
constants
.
DISCUSSION
}
});
findCommentDropdownOption
().
vm
.
$emit
(
'
click
'
);
findDiscussionDropdownOption
().
vm
.
$emit
(
'
click
'
);
const
event
=
{
type
:
'
click
'
,
stopPropagation
:
jest
.
fn
(),
preventDefault
:
jest
.
fn
(),
};
findCommentDropdownOption
().
vm
.
$emit
(
'
click
'
,
event
);
findDiscussionDropdownOption
().
vm
.
$emit
(
'
click
'
,
event
);
// ensure the native events don't trigger anything
expect
(
event
.
stopPropagation
).
toHaveBeenCalledTimes
(
2
);
expect
(
event
.
preventDefault
).
toHaveBeenCalledTimes
(
2
);
expect
(
wrapper
.
emitted
(
'
change
'
)[
0
]).
toEqual
([
constants
.
COMMENT
]);
expect
(
wrapper
.
emitted
(
'
change
'
).
length
).
toEqual
(
1
);
...
...
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