Skip to content

A platform for community discussion. Free, open, simple.

DEV: prevents flakey in autocomplete hashtag (#21786)

Joffrey JAFFEUX4303d4711f81
diff --git a/spec/system/hashtag_autocomplete_spec.rb b/spec/system/hashtag_autocomplete_spec.rb
index 1c8c0bc79f2..cc7d40a94df 100644
--- a/spec/system/hashtag_autocomplete_spec.rb
+++ b/spec/system/hashtag_autocomplete_spec.rb
@@ -77,10 +77,13 @@ describe "Using #hashtag autocompletion to search for and lookup categories and
it "cooks the hashtags for tag and category correctly serverside when the post is saved to the database" do
topic_page.visit_topic_and_open_composer(topic)
+
expect(topic_page).to have_expanded_composer
- topic_page.type_in_composer("this is a #cool-cat category and a #cooltag tag")
- topic_page.send_reply
+
+ topic_page.send_reply("this is a #cool-cat category and a #cooltag tag")
+
expect(topic_page).to have_post_number(2)
+
cooked_hashtags = page.all(".hashtag-cooked", count: 2)
expect(cooked_hashtags[0]["outerHTML"]).to eq(<<~HTML.chomp)
diff --git a/spec/system/page_objects/pages/topic.rb b/spec/system/page_objects/pages/topic.rb
index 623f0c3119c..dbc56fe3d40 100644
--- a/spec/system/page_objects/pages/topic.rb
+++ b/spec/system/page_objects/pages/topic.rb
@@ -119,7 +119,8 @@ module PageObjects
@composer_component.has_popup_content?(content)
end
- def send_reply
+ def send_reply(content = nil)
+ fill_in_composer(content) if content
find("#reply-control .save-or-cancel .create").click
end