This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 204204 expect ( header ) . to have_icon_in_bot_button ( icon : "robot" )
205205 end
206206
207- it "displays 'new question' button on the topic page" do
207+ it "displays 'new question' button on homepage and topic page" do
208208 topic_page . visit_topic ( pm )
209- expect ( sidebar ) . to have_css (
210- "button.ai-new-question-button" ,
211- text : I18n . t ( "js.discourse_ai.ai_bot.conversations.new" ) ,
212- )
213- end
209+ expect ( ai_pm_homepage ) . to have_new_question_button
214210
215- it "displays 'new question' button on the topic page" do
216211 ai_pm_homepage . visit
217- expect ( sidebar ) . to have_css (
218- "button.ai-new-question-button" ,
219- text : I18n . t ( "js.discourse_ai.ai_bot.conversations.new" ) ,
220- )
212+ expect ( ai_pm_homepage ) . to have_new_question_button
221213 end
222214
223215 it "displays sidebar and 'new question' on the topic page" do
Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ def has_no_new_question_button?
3636 page . has_no_css? ( ".ai-new-question-button" )
3737 end
3838
39+ def has_new_question_button?
40+ sidebar = PageObjects ::Components ::NavigationMenu ::Sidebar . new
41+ sidebar . has_css? (
42+ "button.ai-new-question-button" ,
43+ text : I18n . t ( "js.discourse_ai.ai_bot.conversations.new" ) ,
44+ )
45+ end
46+
3947 def click_new_question_button
4048 page . find ( ".ai-new-question-button" ) . click
4149 end
You can’t perform that action at this time.
0 commit comments