summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2017-04-18 10:27:10 -0500
committerClement Ho <ClemMakesApps@gmail.com>2017-04-18 10:27:10 -0500
commit7f66e8ad17141cbe8a1b87adce665f49f94a4aa4 (patch)
tree6f94d531422a05b94672f2fea4c437a033b7391f /spec
parent9ec58d8a67c611a5544c0994a8ef9f350a94d2db (diff)
downloadgitlab-ce-7f66e8ad17141cbe8a1b87adce665f49f94a4aa4.tar.gz
Add tests
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/icons_helper_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/helpers/icons_helper_spec.rb b/spec/helpers/icons_helper_spec.rb
index c052981fe73..c3f78d3d61f 100644
--- a/spec/helpers/icons_helper_spec.rb
+++ b/spec/helpers/icons_helper_spec.rb
@@ -1,6 +1,19 @@
require 'spec_helper'
describe IconsHelper do
+ describe 'icon' do
+ it 'returns aria-hidden by default' do
+ star = icon('star')
+ expect(star['aria-hidden']).to eq 'aria-hidden'
+ end
+
+ it 'does not return aria-hidden if aria-label is set' do
+ up = icon('up', 'aria-label' => 'up')
+ expect(up['aria-hidden']).to eq nil
+ expect(up['aria-label']).to eq 'aria-label'
+ end
+ end
+
describe 'file_type_icon_class' do
it 'returns folder class' do
expect(file_type_icon_class('folder', 0, 'folder_name')).to eq 'folder'