diff options
Diffstat (limited to 'test/system/reactions_test.rb')
-rw-r--r-- | test/system/reactions_test.rb | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/test/system/reactions_test.rb b/test/system/reactions_test.rb index 01ba76832..96dd4cf81 100644 --- a/test/system/reactions_test.rb +++ b/test/system/reactions_test.rb @@ -113,6 +113,47 @@ class ReactionsSystemTest < ApplicationSystemTestCase end end + def test_reaction_button_is_visible_on_property_changes_tab + # Create a journal with no notes + journal_without_notes = Journal.generate!(journalized: issues(:issues_001), notes: '', details: [JournalDetail.new]) + + log_user('jsmith', 'jsmith') + + visit '/issues/1?tab=properties' + + # Scroll to the history content + click_link '#1' + + assert_selector '#tab-properties.selected' + + within('#change-1') do + assert_selector 'a.reaction-button' + + assert_no_selector 'a.icon-quote' + assert_no_selector 'span.drdn' + end + within("#change-#{journal_without_notes.id}") do + assert_selector 'a.reaction-button' + + assert_no_selector '.drdn' + end + + click_link 'History' + + within('#change-1') do + assert_selector 'a.reaction-button' + + assert_selector 'a.icon-quote' + assert_selector 'span.drdn' + end + within("#change-#{journal_without_notes.id}") do + assert_selector 'a.reaction-button' + assert_selector 'span.drdn' + + assert_no_selector 'a.icon-quote' + end + end + private def assert_reaction_add_and_remove(reaction_button, expected_subject) @@ -126,7 +167,7 @@ class ReactionsSystemTest < ApplicationSystemTestCase # Remove the reaction within(reaction_button) { find('a.reacted').click } within(reaction_button) { assert_selector('a.reaction-button:not(.reacted)') } - assert_equal "0", reaction_button.text + assert_equal "", reaction_button.text assert_equal 0, expected_subject.reactions.count end end |