From 6e9c2cb935db88988b95819be2b79819d1b50697 Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Tue, 15 Sep 2020 16:30:58 -0400 Subject: [PATCH] merge ... and + buttons for more tags in sidebar (#8386) * merge ... and + buttons for more tags in sidebar * Update _tags.html.erb * revert test changes from https://github.com/publiclab/plots2/pull/7715/ --- app/views/tag/_tagging.html.erb | 2 ++ app/views/tag/_tags.html.erb | 3 +++ test/system/post_test.rb | 8 ++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/tag/_tagging.html.erb b/app/views/tag/_tagging.html.erb index 4e04ca4167..2696043023 100644 --- a/app/views/tag/_tagging.html.erb +++ b/app/views/tag/_tagging.html.erb @@ -60,6 +60,8 @@ $(function () { $("#tags-open").click(function(){ $("#tagform").show(); $("#tags-open").hide(); + $('.more-tags').show(); + $('.show-more-tags').hide(); $(".tag-input").focus(); }); diff --git a/app/views/tag/_tags.html.erb b/app/views/tag/_tags.html.erb index b65cb17668..a3e7a9d8c9 100644 --- a/app/views/tag/_tags.html.erb +++ b/app/views/tag/_tags.html.erb @@ -32,6 +32,9 @@ $('.show-more-tags').click(function showMoreTags() { $('.more-tags').show(); $('.show-more-tags').hide(); + $("#tagform").show(); + $("#tags-open").hide(); + $(".tag-input").focus(); }); })(); diff --git a/test/system/post_test.rb b/test/system/post_test.rb index a95c455682..bc0e4605a6 100644 --- a/test/system/post_test.rb +++ b/test/system/post_test.rb @@ -50,11 +50,11 @@ def setup # 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) + page.assert_selector('.tags-list p.badge', :count => 1) - # accept_alert do - # find('.tags-list p.badge .tag-delete').click() - # end + accept_alert do + find('.tags-list p.badge .tag-delete').click() + end # Make sure that 1 of the 3 tags is removed page.assert_selector('.tags-list p.badge', :count => 0)