Skip to content

Commit

Permalink
FIX: Wiki revisions test (publiclab#7396)
Browse files Browse the repository at this point in the history
This test has already been fixed before but recently it has failed again
in publiclab#7319. The problem might be related to our selection of "Revert"
button.

Inside of the button we have an empty space before the text
and a font-awesome icon(<i>).
We were selecting the button with #row0 and the text of "Revert" which
probably caused the issue.

I've added the btn-revert class to avoid this strange behaviour.
  • Loading branch information
VladimirMikulic authored and Vinit Shahdeo committed Feb 1, 2020
1 parent 41472db commit 70a8d64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/wiki/revisions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
| <%= distance_of_time_in_words(revision.created_at, Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' }) %>
<div style="display:none;" id="body_<%= @node.revisions.length-1-index %>"><%= raw RDiscount.new(revision.body).to_html %></div>
</td>
<td><small><a class="btn btn-sm btn-outline-secondary" href="/wiki/revert/<%= revision.vid %>" data-confirm="<%= translation('wiki.revisions.are_you_sure') %>"><i class="fa fa-arrow-reload"></i> <%= translation('wiki.revisions.revert') %></a></small></td>
<td><small><a class="btn btn-sm btn-outline-secondary btn-revert" href="/wiki/revert/<%= revision.vid %>" data-confirm="<%= translation('wiki.revisions.are_you_sure') %>"><i class="fa fa-arrow-reload"></i> <%= translation('wiki.revisions.revert') %></a></small></td>
<% if logged_in_as(['admin', 'moderator']) %>
<% if revision.status == 1 %>
<td><small><a class='btn btn-sm btn-outline-secondary' data-toggle="tooltip" title="Mark as Spam" data-placement="top" href='/moderate/revision/spam/<%= revision.vid %>' data-confirm="<%= translation('wiki.revisions.are_you_sure') %>"><i class='fa fa-ban'></i></a></small></td>
Expand Down
2 changes: 1 addition & 1 deletion test/system/post_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def assert_page_does_not_reload(message = "page should not reload")

accept_confirm "Are you sure?" do
# revert to the previous version of wiki
find('#row0 a[data-confirm="Are you sure?"]', text: "Revert").click()
find('#row0 .btn-revert').click()
end

wiki_content = find("#content p").text
Expand Down

0 comments on commit 70a8d64

Please sign in to comment.