summaryrefslogtreecommitdiff
path: root/qa/qa/page/component/web_ide/alert.rb
blob: 0f0623d5ebf116b4eca897a01171507e96c3ddbd (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 Component
      module WebIDE
        module Alert
          def self.prepended(page)
            page.module_eval do
              view 'app/assets/javascripts/ide/components/error_message.vue' do
                element :flash_alert
              end
            end
          end

          def has_no_alert?(message = nil)
            return has_no_element?(:flash_alert) if message.nil?

            within_element(:flash_alert) do
              has_no_text?(message)
            end
          end
        end
      end
    end
  end
end