X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1586823b65c7ec7656626e491a31f3f9516a4a56..42c20b25e1325124b88e3b9b285544dc41122b56:/apps/workbench/test/integration/container_requests_test.rb diff --git a/apps/workbench/test/integration/container_requests_test.rb b/apps/workbench/test/integration/container_requests_test.rb index 46f7e171fb..151654b231 100644 --- a/apps/workbench/test/integration/container_requests_test.rb +++ b/apps/workbench/test/integration/container_requests_test.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'integration_helper' class ContainerRequestsTest < ActionDispatch::IntegrationTest @@ -121,4 +125,37 @@ class ContainerRequestsTest < ActionDispatch::IntegrationTest page.assert_selector 'ellipse+text', text: cr['name'], visible: false page.assert_selector 'g.node>title', text: cr['uuid'], visible: false end + + test "index page" do + visit page_with_token("active", "/container_requests") + + within(".arv-recent-container-requests") do + page.execute_script "window.scrollBy(0,999000)" + wait_for_ajax + end + + running_owner_active = api_fixture("container_requests", "requester_for_running") + anon_accessible_cr = api_fixture("container_requests", "running_anonymous_accessible") + + # both of these CRs should be accessible to the user + assert_selector "a[href=\"/container_requests/#{running_owner_active['uuid']}\"]", text: running_owner_active[:name] + assert_selector "a[href=\"/container_requests/#{anon_accessible_cr['uuid']}\"]", text: anon_accessible_cr[:name] + + # user can delete the "running" container_request + within(".cr-#{running_owner_active['uuid']}") do + assert_not_nil first('.glyphicon-trash') + end + + # user can not delete the anonymously accessible container_request + within(".cr-#{anon_accessible_cr['uuid']}") do + assert_nil first('.glyphicon-trash') + end + + # verify the search box in the page + find('.recent-container-requests-filterable-control').set("anonymous") + sleep 0.350 # Wait for 250ms debounce timer (see filterable.js) + wait_for_ajax + assert_no_selector "a[href=\"/container_requests/#{running_owner_active['uuid']}\"]", text: running_owner_active[:name] + assert_selector "a[href=\"/container_requests/#{anon_accessible_cr['uuid']}\"]", text: anon_accessible_cr[:name] + end end