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:
Javi Martín
2021-03-30 20:00:57 +02:00
parent 23945c2a7c
commit 9cfcbf2f3b
15 changed files with 122 additions and 121 deletions

View File

@@ -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")