diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 03:07:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 03:07:51 +0000 |
commit | 83a3209c3f8e5bc055acf80f3440335d2b97133b (patch) | |
tree | 0bb8d48ee018534d319311358f7dab6549b752e1 /spec/helpers | |
parent | f6e2f302412fcb32b644b379778964791789cb62 (diff) | |
download | gitlab-ce-83a3209c3f8e5bc055acf80f3440335d2b97133b.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/emoji_helper_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/helpers/emoji_helper_spec.rb b/spec/helpers/emoji_helper_spec.rb new file mode 100644 index 00000000000..1b73e956f7a --- /dev/null +++ b/spec/helpers/emoji_helper_spec.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe EmojiHelper do + describe '#emoji_icon' do + let(:options) { {} } + let(:emoji_text) { 'rocket' } + let(:aria_hidden_option) { "aria-hidden=\"true\"" } + + subject { helper.emoji_icon(emoji_text, options) } + + it 'has no options' do + is_expected.to include('<gl-emoji', + "title=\"#{emoji_text}\"", + "data-name=\"#{emoji_text}\"", + "data-unicode-version=\"#{::Gitlab::Emoji.emoji_unicode_version(emoji_text)}\"") + is_expected.not_to include(aria_hidden_option) + end + + context 'with aria-hidden option' do + let(:options) { { 'aria-hidden': true } } + + it 'applies aria-hidden' do + is_expected.to include('<gl-emoji', + "title=\"#{emoji_text}\"", + "data-name=\"#{emoji_text}\"", + "data-unicode-version=\"#{::Gitlab::Emoji.emoji_unicode_version(emoji_text)}\"", + aria_hidden_option) + end + end + end +end |