Skip to content

Commit

Permalink
fix system test
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Feb 7, 2024
1 parent a00be54 commit d41aad5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@
<div class="c-accordion text-newsletterblue" data-component="accordion">
<% (1..4).each do |num| %>
<button role="heading" aria-level="3" class="flex flex-col gap-8 w-full bg-gray-6">
<a href="#" id="accordion-trigger-<%= num %>" class="c-accordion__trigger bg-gray-6 px-8 py-4 w-full hover:underline flex items-center justify-between" data-controls="accordion-panel-<%= num %>">
<a href="#" id="body-trigger-<%= num %>" class="c-accordion__trigger uppercase bg-gray-6 px-8 py-4 w-full hover:underline flex items-center justify-between" data-controls="accordion-panel-<%= num %>">
<span><%= t(".boxes_number_title", number: num) %>:</span>
<svg width="1em" height="1em" role="img" aria-hidden="true">
<use href="/decidim-packs/media/images/remixicon.symbol-e643e553623ffcd49f94.svg#ri-add-line" tabindex="-1" />
</svg>
<%= icon "add-line" %>
</a>
</button>
<div id="accordion-panel-<%= num %>" class="c-accordion__panel">
Expand Down Expand Up @@ -70,11 +68,9 @@
<div class="text-newsletterblue" data-component="accordion">
<% (1..3).each do |num| %>
<button role="heading" aria-level="3" class="flex flex-col gap-8 w-full bg-gray-6">
<a href="#" id="trigger-<%= num %>" data-controls="panel-<%= num %>" class="bg-gray-6 px-8 py-4 w-full hover:underline flex items-center justify-between">
<a href="#" id="footer-trigger-<%= num %>" data-controls="panel-<%= num %>" class="uppercase bg-gray-6 px-8 py-4 w-full hover:underline flex items-center justify-between">
<span><%= t(".boxes_number_title", number: num) %>:</span>
<svg width="1em" height="1em" role="img" aria-hidden="true">
<use href="/decidim-packs/media/images/remixicon.symbol-e643e553623ffcd49f94.svg#ri-add-line" tabindex="-1" />
</svg>
<%= icon "add-line" %>
</a>
</button>
<div id="panel-<%= num %>" aria-hidden="true">
Expand Down
8 changes: 4 additions & 4 deletions spec/system/agenda_events_settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
expect(page).to have_content("EVENT 4:")
expect(page).to have_content("The body of the newsletter can contain up to 4 events")

click_link_or_button "Event 1:"
find("#body-trigger-1").click
expect(page).to have_content("Body event title")

click_link_or_button "Footer"
Expand All @@ -77,7 +77,7 @@
expect(page).to have_content("EVENT 3:")
expect(page).to have_content("The newsletter footer can contain up to 3 events.")

click_link_or_button "Event 1:"
find("#footer-trigger-1").click
expect(page).to have_content("Footer event title")

expect(page).to have_content("Organization address")
Expand All @@ -99,7 +99,7 @@
find('input[name="newsletter[settings][body_subtitle_en]"]').fill_in with: "Body subtitle"

(1..4).each do |i|
click_link_or_button "Event #{i}:"
find("#body-trigger-#{i}").click
find("input[name='newsletter[settings][body_box_title_#{i}_en]']").fill_in with: "Event title #{i}"
find("input[name='newsletter[settings][body_box_date_time_#{i}_en]']").fill_in with: i.days.from_now.strftime("%d/%m/%Y")
find("input[name='newsletter[settings][body_box_description_#{i}_en]']").fill_in with: "Event description #{i}"
Expand All @@ -116,7 +116,7 @@
find("input[name='newsletter[settings][mastodon_handler]']").fill_in with: "super_mastodon"

(1..3).each do |i|
click_link_or_button "Event #{i}:"
find("#footer-trigger-#{i}").click
find("input[name='newsletter[settings][footer_box_date_time_#{i}_en]']").fill_in with: 5.days.from_now.strftime("%d/%m/%Y")
find("input[name='newsletter[settings][footer_box_title_#{i}_en]']").fill_in with: "Footer event title #{i}"
find("input[name='newsletter[settings][footer_box_link_text_#{i}_en]']").fill_in with: "Footer event link #{i}"
Expand Down

0 comments on commit d41aad5

Please sign in to comment.