Use visible texts in tests
Content like lowercase letters with `text-transform: uppercase` or spaces after elements with `display: block` or "You're on page:" are not seen that way by users with a browser supporting CSS. So we're testing what most users actually experience.
This commit is contained in:
@@ -112,7 +112,7 @@ describe "Homepage", :admin do
|
||||
xscenario "Deactivate"
|
||||
end
|
||||
|
||||
scenario "Cards" do
|
||||
scenario "Cards", :js do
|
||||
card1 = create(:widget_card, label: "Card1 label",
|
||||
title: "Card1 text",
|
||||
description: "Card1 description",
|
||||
@@ -130,8 +130,8 @@ describe "Homepage", :admin do
|
||||
expect(page).to have_css(".card", count: 2)
|
||||
|
||||
within("#widget_card_#{card1.id}") do
|
||||
expect(page).to have_content("Card1 label")
|
||||
expect(page).to have_content("Card1 text")
|
||||
expect(page).to have_content("CARD1 LABEL")
|
||||
expect(page).to have_content("CARD1 TEXT")
|
||||
expect(page).to have_content("Card1 description")
|
||||
expect(page).to have_content("Link1 text")
|
||||
expect(page).to have_link(href: "consul1.dev")
|
||||
@@ -139,8 +139,8 @@ describe "Homepage", :admin do
|
||||
end
|
||||
|
||||
within("#widget_card_#{card2.id}") do
|
||||
expect(page).to have_content("Card2 label")
|
||||
expect(page).to have_content("Card2 text")
|
||||
expect(page).to have_content("CARD2 LABEL")
|
||||
expect(page).to have_content("CARD2 TEXT")
|
||||
expect(page).to have_content("Card2 description")
|
||||
expect(page).to have_content("Link2 text")
|
||||
expect(page).to have_link(href: "consul2.dev")
|
||||
|
||||
Reference in New Issue
Block a user