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
4fab2f11
Commit
4fab2f11
authored
Aug 25, 2020
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use subset for emojis in specs
Do not pull the whole set of emojies (~185Kb) in specs.
parent
e16b41d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
10 deletions
+54
-10
spec/frontend/awards_handler_spec.js
spec/frontend/awards_handler_spec.js
+39
-7
spec/frontend/behaviors/gl_emoji_spec.js
spec/frontend/behaviors/gl_emoji_spec.js
+14
-1
spec/frontend/emoji/emoji_spec.js
spec/frontend/emoji/emoji_spec.js
+1
-2
No files found.
spec/frontend/awards_handler_spec.js
View file @
4fab2f11
...
...
@@ -4,7 +4,6 @@ import MockAdapter from 'axios-mock-adapter';
import
{
useFakeRequestAnimationFrame
}
from
'
helpers/fake_request_animation_frame
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
loadAwardsHandler
from
'
~/awards_handler
'
;
import
{
setTestTimeout
}
from
'
./helpers/timeout
'
;
import
{
EMOJI_VERSION
}
from
'
~/emoji
'
;
window
.
gl
=
window
.
gl
||
{};
...
...
@@ -17,7 +16,44 @@ const urlRoot = gon.relative_url_root;
describe
(
'
AwardsHandler
'
,
()
=>
{
useFakeRequestAnimationFrame
();
const
emojiData
=
getJSONFixture
(
'
emojis/emojis.json
'
);
const
emojiData
=
{
'
8ball
'
:
{
c
:
'
activity
'
,
e
:
'
🎱
'
,
d
:
'
billiards
'
,
u
:
'
6.0
'
,
},
grinning
:
{
c
:
'
people
'
,
e
:
'
😀
'
,
d
:
'
grinning face
'
,
u
:
'
6.1
'
,
},
angel
:
{
c
:
'
people
'
,
e
:
'
👼
'
,
d
:
'
baby angel
'
,
u
:
'
6.0
'
,
},
anger
:
{
c
:
'
symbols
'
,
e
:
'
💢
'
,
d
:
'
anger symbol
'
,
u
:
'
6.0
'
,
},
alien
:
{
c
:
'
people
'
,
e
:
'
👽
'
,
d
:
'
extraterrestrial alien
'
,
u
:
'
6.0
'
,
},
sunglasses
:
{
c
:
'
people
'
,
e
:
'
😎
'
,
d
:
'
smiling face with sunglasses
'
,
u
:
'
6.0
'
,
},
};
preloadFixtures
(
'
snippets/show.html
'
);
const
openAndWaitForEmojiMenu
=
(
sel
=
'
.js-add-award
'
)
=>
{
...
...
@@ -25,7 +61,7 @@ describe('AwardsHandler', () => {
.
eq
(
0
)
.
click
();
jest
.
advanceTimersByTime
(
200
);
jest
.
runOnlyPendingTimers
(
);
const
$menu
=
$
(
'
.emoji-menu
'
);
...
...
@@ -37,10 +73,6 @@ describe('AwardsHandler', () => {
};
beforeEach
(
async
()
=>
{
// These tests have had some timeout issues
// https://gitlab.com/gitlab-org/gitlab/-/issues/221086
setTestTimeout
(
6000
);
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
`/-/emojis/
${
EMOJI_VERSION
}
/emojis.json`
).
reply
(
200
,
emojiData
);
...
...
spec/frontend/behaviors/gl_emoji_spec.js
View file @
4fab2f11
...
...
@@ -10,7 +10,20 @@ jest.mock('~/emoji/support');
describe
(
'
gl_emoji
'
,
()
=>
{
let
mock
;
const
emojiData
=
getJSONFixture
(
'
emojis/emojis.json
'
);
const
emojiData
=
{
grey_question
:
{
c
:
'
symbols
'
,
e
:
'
❔
'
,
d
:
'
white question mark ornament
'
,
u
:
'
6.0
'
,
},
bomb
:
{
c
:
'
objects
'
,
e
:
'
💣
'
,
d
:
'
bomb
'
,
u
:
'
6.0
'
,
},
};
beforeAll
(()
=>
{
jest
.
spyOn
(
EmojiUnicodeSupport
,
'
default
'
).
mockReturnValue
(
true
);
...
...
spec/frontend/emoji/emoji_spec.js
View file @
4fab2f11
...
...
@@ -55,11 +55,10 @@ const emojiFixtureMap = {
describe
(
'
gl_emoji
'
,
()
=>
{
let
mock
;
const
emojiData
=
getJSONFixture
(
'
emojis/emojis.json
'
);
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
`/-/emojis/
${
EMOJI_VERSION
}
/emojis.json`
).
reply
(
200
,
emojiData
);
mock
.
onGet
(
`/-/emojis/
${
EMOJI_VERSION
}
/emojis.json`
).
reply
(
200
);
return
initEmojiMap
().
catch
(()
=>
{});
});
...
...
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