From 4dc92f1d3aa161e610402c6ac2990b69c815f53d Mon Sep 17 00:00:00 2001 From: Manasa2850 Date: Wed, 23 Jun 2021 23:57:01 +0530 Subject: [PATCH 01/15] added minicard for power tag --- app/views/tag/_miniCard.html.erb | 2 +- app/views/tag/_tags.html.erb | 22 +--------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/app/views/tag/_miniCard.html.erb b/app/views/tag/_miniCard.html.erb index b5c54d79e5..b960ace8af 100644 --- a/app/views/tag/_miniCard.html.erb +++ b/app/views/tag/_miniCard.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/tag/_tags.html.erb b/app/views/tag/_tags.html.erb index a9de5fe1ff..f8373ba87c 100644 --- a/app/views/tag/_tags.html.erb +++ b/app/views/tag/_tags.html.erb @@ -18,27 +18,7 @@

<%= tags.length - 2 %> more  

<% end %> - + <%= render partial: 'tag/miniCard', locals: { tag: tag, grey: power_tag } %> <% end %> From d09fc3d49faa7550ac4aa70fa0865614aa56e88f Mon Sep 17 00:00:00 2001 From: Manasa2850 Date: Thu, 24 Jun 2021 00:44:31 +0530 Subject: [PATCH 02/15] fix failing system tests --- test/system/post_test.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/system/post_test.rb b/test/system/post_test.rb index 00da97ccde..a71843fb03 100644 --- a/test/system/post_test.rb +++ b/test/system/post_test.rb @@ -48,9 +48,8 @@ def setup find('a#tags-open').click() - # There should be 1 tag that shows up as a badge and 2 as a card - page.assert_selector('.tags-list .card-body', :count => 2) - page.assert_selector('.tags-list p.badge', :count => 1) + # There should be 3 tags that show up as a card + page.assert_selector('.tags-list .card-body', :count => 3) accept_alert do find('.tags-list p.badge .tag-delete').click() @@ -220,8 +219,8 @@ def assert_page_does_not_reload(message = "page should not reload") find('a#tags-open').click() # Make sure proper latitude and longitude tags are added - assert_selector('.tags-list .badge a[href="/tag/lat:22"]', text: "lat:22") - assert_selector('.tags-list .badge a[href="/tag/lon:76"]', text: "lon:76") + assert_selector('.tags-list .card-body a[href="/tag/lat:22"]', text: "lat:22") + assert_selector('.tags-list .card-body a[href="/tag/lon:76"]', text: "lon:76") end test 'deleting a wiki' do From c89e1a0fad17b6f4b256dc97b02d6c9d6ab7f72d Mon Sep 17 00:00:00 2001 From: Manasa2850 Date: Thu, 24 Jun 2021 07:58:05 +0530 Subject: [PATCH 03/15] fix failing system tests --- test/system/post_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/system/post_test.rb b/test/system/post_test.rb index a71843fb03..50e30354ef 100644 --- a/test/system/post_test.rb +++ b/test/system/post_test.rb @@ -52,11 +52,11 @@ def setup page.assert_selector('.tags-list .card-body', :count => 3) accept_alert do - find('.tags-list p.badge .tag-delete').click() + find('.tags-list .card-body .tag-delete').click() end # Make sure that 1 of the 3 tags is removed - page.assert_selector('.tags-list p.badge', :count => 0) + page.assert_selector('.tags-list .card-body', :count => 2) end test 'like button on the post' do From 122f5eea3e1dde75193ef18a566139300d929257 Mon Sep 17 00:00:00 2001 From: Manasa2850 Date: Thu, 24 Jun 2021 08:35:31 +0530 Subject: [PATCH 04/15] fix failing system tests --- test/system/post_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/system/post_test.rb b/test/system/post_test.rb index 50e30354ef..2a7716a966 100644 --- a/test/system/post_test.rb +++ b/test/system/post_test.rb @@ -40,7 +40,7 @@ def setup find('.tag-input').set('mountains').native.send_keys(:return) # Make sure that the 2 tags are added - page.assert_selector('.tags-list p.badge', :count => 2) + page.assert_selector('.tags-list .card', :count => 2) end test 'removing tags from the post' do @@ -56,7 +56,7 @@ def setup end # Make sure that 1 of the 3 tags is removed - page.assert_selector('.tags-list .card-body', :count => 2) + page.assert_selector('.tags-list .card-body', :count => 0) end test 'like button on the post' do From 89d0372305731d56582877982d7113caf04d147d Mon Sep 17 00:00:00 2001 From: Manasa2850 Date: Thu, 24 Jun 2021 10:35:52 +0530 Subject: [PATCH 05/15] changed card to card-body --- test/system/post_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/system/post_test.rb b/test/system/post_test.rb index 2a7716a966..706dda4963 100644 --- a/test/system/post_test.rb +++ b/test/system/post_test.rb @@ -40,7 +40,7 @@ def setup find('.tag-input').set('mountains').native.send_keys(:return) # Make sure that the 2 tags are added - page.assert_selector('.tags-list .card', :count => 2) + page.assert_selector('.tags-list .card-body', :count => 2) end test 'removing tags from the post' do From ca6b7cc7e0a2c946966956018bdd080da1cc3d2f Mon Sep 17 00:00:00 2001 From: Manasa2850 Date: Thu, 24 Jun 2021 10:43:11 +0530 Subject: [PATCH 06/15] added onClick check --- test/system/post_test.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/system/post_test.rb b/test/system/post_test.rb index 706dda4963..29ed54d10d 100644 --- a/test/system/post_test.rb +++ b/test/system/post_test.rb @@ -51,6 +51,8 @@ def setup # There should be 3 tags that show up as a card page.assert_selector('.tags-list .card-body', :count => 3) + find('.tags-list .card-body .ellipsis').click() + accept_alert do find('.tags-list .card-body .tag-delete').click() end From 768f986eec723f1834d8721f715f975ce89f298d Mon Sep 17 00:00:00 2001 From: Manasa2850 Date: Thu, 24 Jun 2021 11:39:01 +0530 Subject: [PATCH 07/15] update post_test.rb --- app/views/tag/_miniCard.html.erb | 3 +++ test/system/post_test.rb | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/views/tag/_miniCard.html.erb b/app/views/tag/_miniCard.html.erb index b960ace8af..5f8b127112 100644 --- a/app/views/tag/_miniCard.html.erb +++ b/app/views/tag/_miniCard.html.erb @@ -1,6 +1,9 @@
+ <% if local_assigns[:grey] %> +
+ <% end %>