DEV: consolidate chat channel notification settings (#29080)

On the chat channel settings page, we want to show a single Send push notifications setting instead of the current Desktop notifications and Mobile push notifications settings.

For existing users, use the Mobile push notifications setting value for the new Send push notifications setting.
This commit is contained in:
David Battersby
2024-10-08 13:13:01 +04:00
committed by GitHub
parent 229773e7a8
commit a7a9148b1e
23 changed files with 97 additions and 132 deletions

View File

@ -122,36 +122,18 @@ RSpec.describe "Channel - Info - Settings page", type: :system do
}.to change { membership.reload.muted }.from(false).to(true)
end
it "can change desktop notification level" do
it "can change notification level" do
chat_page.visit_channel_settings(channel_1)
membership = channel_1.membership_for(current_user)
expect {
select_kit =
PageObjects::Components::SelectKit.new(
".c-channel-settings__desktop-notifications-selector",
)
PageObjects::Components::SelectKit.new(".c-channel-settings__notifications-selector")
select_kit.expand
select_kit.select_row_by_name("Never")
expect(toasts).to have_success(I18n.t("js.saved"))
}.to change { membership.reload.desktop_notification_level }.from("mention").to("never")
end
it "can change mobile notification level" do
chat_page.visit_channel_settings(channel_1)
membership = channel_1.membership_for(current_user)
expect {
select_kit =
PageObjects::Components::SelectKit.new(
".c-channel-settings__mobile-notifications-selector",
)
select_kit.expand
select_kit.select_row_by_name("Never")
expect(toasts).to have_success(I18n.t("js.saved"))
}.to change { membership.reload.mobile_notification_level }.from("mention").to("never")
}.to change { membership.reload.notification_level }.from("mention").to("never")
end
it "can unfollow channel" do