Merge branch 'master' into 11870-repositories-index
[arvados.git] / apps / workbench / test / integration / user_agreements_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'integration_helper'
6
7 class UserAgreementsTest < ActionDispatch::IntegrationTest
8
9   setup do
10     need_javascript
11   end
12
13   def continuebutton_selector
14     'input[type=submit][disabled][value=Continue]'
15   end
16
17   test "cannot click continue without ticking checkbox" do
18     visit page_with_token('inactive')
19     assert_selector continuebutton_selector
20   end
21
22   test "continue button is enabled after ticking checkbox" do
23     visit page_with_token('inactive')
24     assert_selector continuebutton_selector
25     find('input[type=checkbox]').click
26     assert_no_selector continuebutton_selector
27     assert_nil(find_button('Continue')[:disabled],
28                'Continue button did not become enabled')
29   end
30
31 end