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
3c019fa1
Commit
3c019fa1
authored
Aug 29, 2019
by
Maneschi Romain
Committed by
Mike Greiling
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make test of note app with comments disabled dry
parent
a8b48e24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
changelogs/unreleased/62673-clean-note-app-tests.yml
changelogs/unreleased/62673-clean-note-app-tests.yml
+5
-0
spec/frontend/notes/components/note_app_spec.js
spec/frontend/notes/components/note_app_spec.js
+15
-16
No files found.
changelogs/unreleased/62673-clean-note-app-tests.yml
0 → 100644
View file @
3c019fa1
---
title
:
make test of note app with comments disabled dry
merge_request
:
32383
author
:
Romain Maneschi
type
:
other
spec/frontend/notes/components/note_app_spec.js
View file @
3c019fa1
...
@@ -133,32 +133,31 @@ describe('note_app', () => {
...
@@ -133,32 +133,31 @@ describe('note_app', () => {
);
);
});
});
it
(
'
should not render form when commenting is disabled
'
,
()
=>
{
it
(
'
should render form comment button as disabled
'
,
()
=>
{
wrapper
.
destroy
();
expect
(
wrapper
.
find
(
'
.js-note-new-discussion
'
).
attributes
(
'
disabled
'
)).
toEqual
(
'
disabled
'
);
});
store
.
state
.
commentsDisabled
=
true
;
it
(
'
updates discussions badge
'
,
()
=>
{
wrapper
=
mountComponent
();
expect
(
document
.
querySelector
(
'
.js-discussions-count
'
).
textContent
).
toEqual
(
'
2
'
);
return
waitForDiscussionsRequest
().
then
(()
=>
{
expect
(
wrapper
.
find
(
'
.js-main-target-form
'
).
exists
()).
toBe
(
false
);
});
});
});
});
it
(
'
should render discussion filter note `commentsDisabled` is true
'
,
()
=>
{
describe
(
'
render with comments disabled
'
,
()
=>
{
wrapper
.
destroy
();
beforeEach
(()
=>
{
setFixtures
(
'
<div class="js-discussions-count"></div>
'
);
Vue
.
http
.
interceptors
.
push
(
mockData
.
individualNoteInterceptor
);
store
.
state
.
commentsDisabled
=
true
;
store
.
state
.
commentsDisabled
=
true
;
wrapper
=
mountComponent
();
wrapper
=
mountComponent
();
return
waitForDiscussionsRequest
().
then
(()
=>
{
return
waitForDiscussionsRequest
();
expect
(
wrapper
.
find
(
'
.js-discussion-filter-note
'
).
exists
()).
toBe
(
true
);
});
});
});
it
(
'
should
render form comment button a
s disabled
'
,
()
=>
{
it
(
'
should
not render form when commenting i
s disabled
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.js-
note-new-discussion
'
).
attributes
(
'
disabled
'
)).
toEqual
(
'
disabled
'
);
expect
(
wrapper
.
find
(
'
.js-
main-target-form
'
).
exists
()).
toBe
(
false
);
});
});
it
(
'
updates discussions badg
e
'
,
()
=>
{
it
(
'
should render discussion filter note `commentsDisabled` is tru
e
'
,
()
=>
{
expect
(
document
.
querySelector
(
'
.js-discussions-count
'
).
textContent
).
toEqual
(
'
2
'
);
expect
(
wrapper
.
find
(
'
.js-discussion-filter-note
'
).
exists
()).
toBe
(
true
);
});
});
});
});
...
...
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