summaryrefslogtreecommitdiff
path: root/qa/qa/page/profile/accounts/show.rb
blob: cf7f7d80cfaaa3d1a91670514f336a067c1cd1ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

module QA
  module Page
    module Profile
      module Accounts
        class Show < Page::Base
          view 'app/views/profiles/accounts/show.html.haml' do
            element :delete_account_button, required: true
          end

          view 'app/assets/javascripts/profile/account/components/delete_account_modal.vue' do
            element :password_confirmation_field
            element :confirm_delete_account_button
          end

          def delete_account(password)
            click_element(:delete_account_button)

            find_element(:password_confirmation_field).set password
            click_element(:confirm_delete_account_button)
          end
        end
      end
    end
  end
end