mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
UX: Do not delete narrative bot PM when skipping user tips (#28265)
Should fix https://meta.discourse.org/t/skip-tips-option-in-user-tip-should-not-delete-welcome-message/303420 Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
This commit is contained in:
32
plugins/discourse-narrative-bot/spec/system/user_spec.rb
Normal file
32
plugins/discourse-narrative-bot/spec/system/user_spec.rb
Normal file
@ -0,0 +1,32 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe "Narrative Bot PM", type: :system do
|
||||
fab!(:admin)
|
||||
fab!(:user)
|
||||
fab!(:topics) { Fabricate.times(2, :post).map(&:topic) }
|
||||
fab!(:posts) { Fabricate.times(3, :post, topic: topics[0]) }
|
||||
|
||||
context "when user tips are enabled" do
|
||||
before do
|
||||
Jobs.run_immediately!
|
||||
SiteSetting.enable_user_tips = true
|
||||
SiteSetting.discourse_narrative_bot_enabled = true
|
||||
# shortcut to generate welcome post since we're not going through user creation or first login
|
||||
user.enqueue_bot_welcome_post
|
||||
end
|
||||
|
||||
it "does not delete the narrative bot PM when skipping all tips" do
|
||||
sign_in user
|
||||
visit "/"
|
||||
|
||||
tooltip = PageObjects::Components::Tooltips.new("user-tip")
|
||||
tooltip.find(".btn", text: "Skip tips").click
|
||||
|
||||
expect(tooltip).to be_not_present
|
||||
expect(page).to have_css(".badge-notification.new-pms")
|
||||
|
||||
find("#toggle-current-user").click
|
||||
expect(page).to have_css(".notification.unread.private-message", text: "Greetings!")
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user