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
5c4cf3b3
Commit
5c4cf3b3
authored
Dec 10, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move emoji_menu_spec.js to Jest
parent
7c4940b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
3 deletions
+7
-3
app/assets/javascripts/pages/profiles/show/emoji_menu.js
app/assets/javascripts/pages/profiles/show/emoji_menu.js
+1
-0
config/jest.config.js
config/jest.config.js
+1
-0
spec/frontend/helpers/test_constants.js
spec/frontend/helpers/test_constants.js
+2
-0
spec/frontend/pages/profiles/show/emoji_menu_spec.js
spec/frontend/pages/profiles/show/emoji_menu_spec.js
+3
-3
No files found.
app/assets/javascripts/pages/profiles/show/emoji_menu.js
View file @
5c4cf3b3
import
'
~/commons/bootstrap
'
;
import
{
AwardsHandler
}
from
'
~/awards_handler
'
;
class
EmojiMenu
extends
AwardsHandler
{
...
...
config/jest.config.js
View file @
5c4cf3b3
...
...
@@ -16,6 +16,7 @@ module.exports = {
testMatch
:
[
'
<rootDir>/spec/frontend/**/*_spec.js
'
],
moduleNameMapper
:
{
'
^~(.*)$
'
:
'
<rootDir>/app/assets/javascripts$1
'
,
'
^helpers(.*)$
'
:
'
<rootDir>/spec/frontend/helpers$1
'
,
},
collectCoverageFrom
:
[
'
<rootDir>/app/assets/javascripts/**/*.{js,vue}
'
],
coverageDirectory
:
'
<rootDir>/coverage-frontend/
'
,
...
...
spec/frontend/helpers/test_constants.js
0 → 100644
View file @
5c4cf3b3
// eslint-disable-next-line import/prefer-default-export
export
const
TEST_HOST
=
'
http://test.host
'
;
spec/
javascripts
/pages/profiles/show/emoji_menu_spec.js
→
spec/
frontend
/pages/profiles/show/emoji_menu_spec.js
View file @
5c4cf3b3
import
$
from
'
jquery
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
EmojiMenu
from
'
~/pages/profiles/show/emoji_menu
'
;
import
{
TEST_HOST
}
from
'
spec
/test_constants
'
;
import
{
TEST_HOST
}
from
'
helpers
/test_constants
'
;
describe
(
'
EmojiMenu
'
,
()
=>
{
const
dummyEmojiTag
=
'
<dummy></tag>
'
;
...
...
@@ -56,7 +56,7 @@ describe('EmojiMenu', () => {
});
it
(
'
does not make an axios requst
'
,
done
=>
{
spyOn
(
axios
,
'
request
'
).
and
.
stub
();
jest
.
spyOn
(
axios
,
'
request
'
).
mockReturnValue
();
emojiMenu
.
addAward
(
dummyVotesBlock
(),
dummyAwardUrl
,
dummyEmoji
,
false
,
()
=>
{
expect
(
axios
.
request
).
not
.
toHaveBeenCalled
();
...
...
@@ -67,7 +67,7 @@ describe('EmojiMenu', () => {
describe
(
'
bindEvents
'
,
()
=>
{
beforeEach
(()
=>
{
spyOn
(
emojiMenu
,
'
registerEventListener
'
).
and
.
stub
();
jest
.
spyOn
(
emojiMenu
,
'
registerEventListener
'
).
mockReturnValue
();
});
it
(
'
binds event listeners to custom toggle button
'
,
()
=>
{
...
...
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