Replace link with button in nofications
This commit is contained in:
@@ -1190,9 +1190,17 @@ form {
|
||||
@include breakpoint(medium) {
|
||||
|
||||
.mark-notification {
|
||||
@include anchor-color;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
top: 12px;
|
||||
|
||||
&:hover,
|
||||
&:active,
|
||||
&:focus {
|
||||
@include anchor-color-hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
<% end %>
|
||||
|
||||
<% if notification.unread? %>
|
||||
<%= link_to t("notifications.notification.mark_as_read"),
|
||||
mark_as_read_notification_path(notification),
|
||||
method: :put,
|
||||
remote: true,
|
||||
class: "mark-notification small" %>
|
||||
<%= button_to t("notifications.notification.mark_as_read"),
|
||||
mark_as_read_notification_path(notification),
|
||||
method: :put,
|
||||
remote: true,
|
||||
class: "mark-notification small" %>
|
||||
<% else %>
|
||||
<%= link_to t("notifications.notification.mark_as_unread"),
|
||||
mark_as_unread_notification_path(notification),
|
||||
method: :put,
|
||||
remote: true,
|
||||
class: "mark-notification small" %>
|
||||
<%= button_to t("notifications.notification.mark_as_unread"),
|
||||
mark_as_unread_notification_path(notification),
|
||||
method: :put,
|
||||
remote: true,
|
||||
class: "mark-notification small" %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
@@ -59,7 +59,7 @@ describe "Notifications" do
|
||||
click_notifications_icon
|
||||
|
||||
within("#notification_#{notification1.id}") do
|
||||
click_link "Mark as read"
|
||||
click_button "Mark as read"
|
||||
end
|
||||
|
||||
expect(page).to have_css(".notification", count: 1)
|
||||
@@ -89,7 +89,7 @@ describe "Notifications" do
|
||||
|
||||
expect(page).to have_css(".notification", count: 1)
|
||||
within("#notification_#{notification1.id}") do
|
||||
click_link "Mark as unread"
|
||||
click_button "Mark as unread"
|
||||
end
|
||||
|
||||
expect(page).to have_css(".notification", count: 0)
|
||||
|
||||
Reference in New Issue
Block a user