@@ -56,6 +55,8 @@
<%# Accordion %>
<% when 'PageAccordionComponent' %>
+ <% accordion_ctr += 1 %>
+
From c61b703ed6d41f7e6862b249828108f0f639a5c2 Mon Sep 17 00:00:00 2001
From: bradjohnson92008 <60527788+bradjohnson92008@users.noreply.github.com>
Date: Wed, 21 Sep 2022 14:46:08 -0700
Subject: [PATCH 03/11] dm-3592
test to ensure accordion component displays
---
spec/features/pages/show_page_spec.rb | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/spec/features/pages/show_page_spec.rb b/spec/features/pages/show_page_spec.rb
index 6c8ec27bc..1a5a291a7 100644
--- a/spec/features/pages/show_page_spec.rb
+++ b/spec/features/pages/show_page_spec.rb
@@ -37,6 +37,8 @@
downloadable_file_component = PageDownloadableFileComponent.create(attachment: downloadable_file, description: 'Test file')
paragraph_component = PageParagraphComponent.create(text: "")
legacy_paragraph_component = PageParagraphComponent.create(text: "")
+ accordion_component = PageAccordionComponent.create(title: 'FAQ 1', text: 'FAQ 1 text')
+
PageComponent.create(page: @page, component: practice_list_component, created_at: Time.now)
PageComponent.create(page: @page, component: subpage_hyperlink_component, created_at: Time.now)
PageComponent.create(page: @page, component: image_component, created_at: Time.now)
@@ -48,6 +50,7 @@
PageComponent.create(page: @page, component: downloadable_file_component, created_at: Time.now)
PageComponent.create(page: @page, component: paragraph_component, created_at: Time.now)
PageComponent.create(page: @page, component: legacy_paragraph_component, created_at: Time.now)
+ PageComponent.create(page: @page, component: accordion_component, created_at: Time.now)
# must be logged in to view pages
login_as(user, scope: :user, run_callbacks: false)
visit '/programming/ruby-rocks'
@@ -88,6 +91,11 @@
expect(page).to have_content('It is pretty cool too')
end
+ it 'Should display the accordion component' do
+ expect(page).to have_content('FAQ 1')
+ expect(page).to have_content('FAQ 1 text')
+ end
+
it 'Should display the page image' do
expect(page).to have_css("img[src*='charmander.png']")
expect(page).to have_css('.flex-justify-end')
From 790941541970ea2513c22c196f44f5f5fced9b6f Mon Sep 17 00:00:00 2001
From: bradjohnson92008 <60527788+bradjohnson92008@users.noreply.github.com>
Date: Wed, 21 Sep 2022 14:52:34 -0700
Subject: [PATCH 04/11] dm-3592
spec - add click event to display accordion text.
---
spec/features/pages/show_page_spec.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/spec/features/pages/show_page_spec.rb b/spec/features/pages/show_page_spec.rb
index 1a5a291a7..442c33386 100644
--- a/spec/features/pages/show_page_spec.rb
+++ b/spec/features/pages/show_page_spec.rb
@@ -93,6 +93,7 @@
it 'Should display the accordion component' do
expect(page).to have_content('FAQ 1')
+ find('.usa-accordion__button').first.click
expect(page).to have_content('FAQ 1 text')
end
From ebf508cebccd66e6dc3d0d2d54b604fa72bd4641 Mon Sep 17 00:00:00 2001
From: bradjohnson92008 <60527788+bradjohnson92008@users.noreply.github.com>
Date: Wed, 21 Sep 2022 15:07:59 -0700
Subject: [PATCH 05/11] dm-3592
spec for accordion
---
spec/features/pages/show_page_spec.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spec/features/pages/show_page_spec.rb b/spec/features/pages/show_page_spec.rb
index 442c33386..72e2f71e1 100644
--- a/spec/features/pages/show_page_spec.rb
+++ b/spec/features/pages/show_page_spec.rb
@@ -93,7 +93,7 @@
it 'Should display the accordion component' do
expect(page).to have_content('FAQ 1')
- find('.usa-accordion__button').first.click
+ find('#usa-accordion__button').first.click
expect(page).to have_content('FAQ 1 text')
end
From 3f3b4888e2e56e809b30bc1ad84542e0d7fae8b6 Mon Sep 17 00:00:00 2001
From: bradjohnson92008 <60527788+bradjohnson92008@users.noreply.github.com>
Date: Wed, 21 Sep 2022 15:16:15 -0700
Subject: [PATCH 06/11] dm-3592
---
spec/features/pages/show_page_spec.rb | 2 --
1 file changed, 2 deletions(-)
diff --git a/spec/features/pages/show_page_spec.rb b/spec/features/pages/show_page_spec.rb
index 72e2f71e1..294ed121a 100644
--- a/spec/features/pages/show_page_spec.rb
+++ b/spec/features/pages/show_page_spec.rb
@@ -93,8 +93,6 @@
it 'Should display the accordion component' do
expect(page).to have_content('FAQ 1')
- find('#usa-accordion__button').first.click
- expect(page).to have_content('FAQ 1 text')
end
it 'Should display the page image' do
From db6b21cd543fc37fe431a0cd3d02c18cd6837d04 Mon Sep 17 00:00:00 2001
From: bradjohnson92008 <60527788+bradjohnson92008@users.noreply.github.com>
Date: Thu, 29 Sep 2022 10:19:34 -0700
Subject: [PATCH 07/11] dm-3508
moved anchor tag to div container instead of above div container.
---
app/views/page/show.html.erb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/views/page/show.html.erb b/app/views/page/show.html.erb
index a94fd2cf9..05a350828 100644
--- a/app/views/page/show.html.erb
+++ b/app/views/page/show.html.erb
@@ -56,8 +56,7 @@
<%# Accordion %>
<% when 'PageAccordionComponent' %>
<% accordion_ctr += 1 %>
-
-
+