Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
fd7f0732
Commit
fd7f0732
authored
7 years ago
by
Nolan Lawson
Committed by
Eugen Rochko
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Compress and combine emoji data (#5229)
parent
eb5ac234
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
spec/javascript/components/emoji_index.test.js
+19
-1
19 additions, 1 deletion
spec/javascript/components/emoji_index.test.js
spec/javascript/components/emojify.test.js
+10
-1
10 additions, 1 deletion
spec/javascript/components/emojify.test.js
with
29 additions
and
2 deletions
spec/javascript/components/emoji_index.test.js
+
19
−
1
View file @
fd7f0732
import
{
expect
}
from
'
chai
'
;
import
{
search
}
from
'
../../../app/javascript/mastodon/
emoji_index
_light
'
;
import
{
search
}
from
'
../../../app/javascript/mastodon/
features/emoji/emoji_mart_search
_light
'
;
import
{
emojiIndex
}
from
'
emoji-mart
'
;
import
{
pick
}
from
'
lodash
'
;
...
...
@@ -78,4 +78,22 @@ describe('emoji_index', () => {
expect
(
emojiIndex
.
search
(
'
flag
'
,
{
include
:
[
'
people
'
]
}))
.
to
.
deep
.
equal
([]);
});
it
(
'
does an emoji whose unified name is irregular
'
,
()
=>
{
let
expected
=
[{
'
id
'
:
'
water_polo
'
,
'
unified
'
:
'
1f93d
'
,
'
native
'
:
'
🤽
'
,
},
{
'
id
'
:
'
man-playing-water-polo
'
,
'
unified
'
:
'
1f93d-200d-2642-fe0f
'
,
'
native
'
:
'
🤽♂️
'
,
},
{
'
id
'
:
'
woman-playing-water-polo
'
,
'
unified
'
:
'
1f93d-200d-2640-fe0f
'
,
'
native
'
:
'
🤽♀️
'
,
}];
expect
(
search
(
'
polo
'
).
map
(
trimEmojis
)).
to
.
deep
.
equal
(
expected
);
expect
(
emojiIndex
.
search
(
'
polo
'
).
map
(
trimEmojis
)).
to
.
deep
.
equal
(
expected
);
});
});
This diff is collapsed.
Click to expand it.
spec/javascript/components/emojify.test.js
+
10
−
1
View file @
fd7f0732
import
{
expect
}
from
'
chai
'
;
import
emojify
from
'
../../../app/javascript/mastodon/emoji
'
;
import
emojify
from
'
../../../app/javascript/mastodon/
features/emoji/
emoji
'
;
describe
(
'
emojify
'
,
()
=>
{
it
(
'
ignores unknown shortcodes
'
,
()
=>
{
...
...
@@ -49,4 +49,13 @@ describe('emojify', () => {
expect
(
emojify
(
'
👌🌈💕
'
)).
to
.
equal
(
'
<img draggable="false" class="emojione" alt="👌" title=":ok_hand:" src="/emoji/1f44c.svg" /><img draggable="false" class="emojione" alt="🌈" title=":rainbow:" src="/emoji/1f308.svg" /><img draggable="false" class="emojione" alt="💕" title=":two_hearts:" src="/emoji/1f495.svg" />
'
);
expect
(
emojify
(
'
👌 🌈 💕
'
)).
to
.
equal
(
'
<img draggable="false" class="emojione" alt="👌" title=":ok_hand:" src="/emoji/1f44c.svg" /> <img draggable="false" class="emojione" alt="🌈" title=":rainbow:" src="/emoji/1f308.svg" /> <img draggable="false" class="emojione" alt="💕" title=":two_hearts:" src="/emoji/1f495.svg" />
'
);
});
it
(
'
does an emoji that has no shortcode
'
,
()
=>
{
expect
(
emojify
(
'
🕉️
'
)).
to
.
equal
(
'
<img draggable="false" class="emojione" alt="🕉️" title="" src="/emoji/1f549.svg" />
'
);
});
it
(
'
does an emoji whose filename is irregular
'
,
()
=>
{
expect
(
emojify
(
'
↙️
'
)).
to
.
equal
(
'
<img draggable="false" class="emojione" alt="↙️" title=":arrow_lower_left:" src="/emoji/2199.svg" />
'
);
});
});
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment