mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-01 07:11:26 +08:00
This spec was not testing the right thing, the draft is not supposed to save if the topic title is too short, but the way the expectations were written (checking the float message) made it pass incorrectly.
35 lines
833 B
Ruby
35 lines
833 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Components
|
|
class Toasts < PageObjects::Components::Base
|
|
def has_default?(message)
|
|
has_css?(".fk-d-default-toast", text: message)
|
|
end
|
|
|
|
def has_success?(message)
|
|
has_css?(".fk-d-default-toast.-success", text: message)
|
|
end
|
|
|
|
def close_button
|
|
find(".fk-d-default-toast__close-container .btn")
|
|
end
|
|
|
|
def has_warning?(message)
|
|
has_css?(".fk-d-default-toast.-warning", text: message)
|
|
end
|
|
|
|
def has_info?(message)
|
|
has_css?(".fk-d-default-toast.-info", text: message)
|
|
end
|
|
|
|
def has_error?(message)
|
|
has_css?(".fk-d-default-toast.-error", text: message)
|
|
end
|
|
|
|
def has_no_message?
|
|
has_no_css?(".fk-d-default-toast__message")
|
|
end
|
|
end
|
|
end
|
|
end
|