mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-28 10:58:23 +08:00
Some checks are pending
Licenses / run (push) Waiting to run
Linting / run (push) Waiting to run
Publish Assets / publish-assets (push) Waiting to run
Tests / core backend (push) Waiting to run
Tests / plugins backend (push) Waiting to run
Tests / core frontend (Chrome) (push) Waiting to run
Tests / plugins frontend (push) Waiting to run
Tests / themes frontend (push) Waiting to run
Tests / core system (push) Waiting to run
Tests / plugins system (push) Waiting to run
Tests / themes system (push) Waiting to run
Tests / core frontend (Firefox ESR) (push) Waiting to run
Tests / core frontend (Firefox Evergreen) (push) Waiting to run
Tests / chat system (push) Waiting to run
Tests / merge (push) Blocked by required conditions
We want to temporarily disable user tips and the Discobot welcome PM
on all sites by default until we have time to improve their
functionality, because
right now they create a lot of noise for new members and admins without
providing obvious benefits.
Existing sites which have customized any of these localization strings will have
`disable_discourse_narrative_bot_welcome_post` kept as `false`:
* system_messages.welcome_user.subject_template OR
* system_messages.welcome_user.text_body_template OR
* discourse_narrative_bot.new_user_narrative.hello.message
Followup revert 70859e277f.
38 lines
1.2 KiB
Ruby
Vendored
38 lines
1.2 KiB
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
describe "Narrative Bot PM", type: :system do
|
|
fab!(:admin)
|
|
fab!(:current_user, :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
|
|
SiteSetting.disable_discourse_narrative_bot_welcome_post = false
|
|
end
|
|
|
|
it "does not delete the narrative bot PM when skipping all tips" do
|
|
sign_in(current_user)
|
|
|
|
# shortcut to generate welcome post since we're not going through user creation or first login
|
|
current_user.enqueue_bot_welcome_post
|
|
|
|
visit("/")
|
|
|
|
tooltip = PageObjects::Components::Tooltips.new("user-tip")
|
|
tooltip.find(".btn", text: I18n.t("js.user_tips.skip")).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: I18n.t("discourse_narrative_bot.new_user_narrative.hello.title"),
|
|
)
|
|
end
|
|
end
|
|
end
|