From: Lucas Di Pentima Date: Wed, 8 Jun 2022 13:21:52 +0000 (-0300) Subject: 19177: Adds test to wb1 for sharing link button hideability. X-Git-Tag: 2.5.0~139^2~1 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/2ed8d670a5d6f93eed57cb14138323cc835e027f 19177: Adds test to wb1 for sharing link button hideability. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb index e7b27fff86..1edfc10505 100644 --- a/apps/workbench/test/integration/collections_test.rb +++ b/apps/workbench/test/integration/collections_test.rb @@ -41,11 +41,19 @@ class CollectionsTest < ActionDispatch::IntegrationTest send(link_assertion, all("a").select { |a| a[:href] =~ link_regexp }) end + test "Hides sharing link button when configured to do so" do + Rails.configuration.Workbench.DisableSharingURLsUI = true + coll_uuid = api_fixture("collections", "collection_owned_by_active", "uuid") + visit page_with_token("active_trustedclient", "/collections/#{coll_uuid}") + assert_no_selector 'input', text: 'Create sharing link' + end + test "creating and uncreating a sharing link" do coll_uuid = api_fixture("collections", "collection_owned_by_active", "uuid") download_link_re = Regexp.new(Regexp.escape("/c=#{coll_uuid}/")) visit page_with_token("active_trustedclient", "/collections/#{coll_uuid}") + assert_selector 'input', text: 'Create sharing link' within "#sharing-button" do check_sharing(:on, download_link_re) check_sharing(:off, download_link_re)