summaryrefslogtreecommitdiff
path: root/qa/qa/page/file/shared/commit_message.rb
blob: a3658fa11aff02dabcf8b721174aa4e34da7f8fa (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
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

module QA
  module Page
    module File
      module Shared
        module CommitMessage
          extend QA::Page::PageConcern

          def self.included(base)
            super

            base.view 'app/assets/javascripts/repository/components/delete_blob_modal.vue' do
              element :commit_message_field
            end

            base.view 'app/views/shared/_commit_message_container.html.haml' do
              element :commit_message_field
            end

            base.view 'app/views/projects/commits/_commit.html.haml' do
              element :commit_content
            end
          end

          def add_commit_message(message)
            fill_element(:commit_message_field, message)
          end

          def has_commit_message?(text)
            has_element?(:commit_content, text: text)
          end
        end
      end
    end
  end
end