summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-02-13 02:47:15 -0800
committerStan Hu <stanhu@gmail.com>2016-02-13 02:47:15 -0800
commit46d35cdbe572e7cad434ed9c61fc264160184aba (patch)
treed11fac1615e12235202598821eea305671a5b90e
parent7ffcc5a17bc462b652e91c1cff36b8baaeb6a41a (diff)
downloadgitlab-ce-fix-me-me-me-me.tar.gz
Add spinach tests for award emojifix-me-me-me-me
-rw-r--r--features/project/issues/award_emoji.feature11
-rw-r--r--features/steps/project/issues/award_emoji.rb26
2 files changed, 36 insertions, 1 deletions
diff --git a/features/project/issues/award_emoji.feature b/features/project/issues/award_emoji.feature
index bfde89fd896..2945bb3753a 100644
--- a/features/project/issues/award_emoji.feature
+++ b/features/project/issues/award_emoji.feature
@@ -7,7 +7,16 @@ Feature: Award Emoji
And I visit "Bugfix" issue page
@javascript
- Scenario: I add and remove award in the issue
+ Scenario: I repeatedly add and remove thumbsup award in the issue
+ Given I click the thumbsup award Emoji
+ Then I have award added
+ Given I click the thumbsup award Emoji
+ Then I have no awards added
+ Given I click the thumbsup award Emoji
+ Then I have award added
+
+ @javascript
+ Scenario: I add and remove custom award in the issue
Given I click to emoji-picker
Then The search field is focused
And I click to emoji in the picker
diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb
index 69695d493f3..8b9aa6aabfa 100644
--- a/features/steps/project/issues/award_emoji.rb
+++ b/features/steps/project/issues/award_emoji.rb
@@ -8,6 +8,15 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
visit namespace_project_issue_path(@project.namespace, @project, @issue)
end
+ step 'I click the thumbsup award Emoji' do
+ page.within '.awards' do
+ thumbsup = page.find('.award .emoji-1F44D')
+ thumbsup.click
+ thumbsup.hover
+ sleep 0.3
+ end
+ end
+
step 'I click to emoji-picker' do
page.within '.awards-controls' do
page.find('.add-award').click
@@ -40,6 +49,23 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
page.within '.awards' do
expect(page).to have_selector '.award'
expect(page.find('.award.active .counter')).to have_content '1'
+ expect(page.find('.award.active')['data-original-title']).to eq('me')
+ end
+ end
+
+ step 'I have no awards added' do
+ page.within '.awards' do
+ expect(page).to have_selector '.award'
+ expect(page.all('.award').size).to eq(2)
+
+ # Check tooltip data
+ page.all('.award').each do |element|
+ expect(element['title']).to eq("")
+ end
+
+ page.all('.award .counter').each do |element|
+ expect(element).to have_content '0'
+ end
end
end