2023-07-13 06:52:03 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
RSpec.describe "Viewing User Menu", system: true do
|
2023-11-10 06:47:59 +08:00
|
|
|
fab!(:user)
|
2023-07-13 06:52:03 +08:00
|
|
|
|
|
|
|
let(:user_menu) { PageObjects::Components::UserMenu.new }
|
|
|
|
|
|
|
|
describe "when viewing replies notifications tab" do
|
2023-11-10 06:47:59 +08:00
|
|
|
fab!(:topic)
|
2023-07-13 06:52:03 +08:00
|
|
|
|
|
|
|
it "should display group mentioned notifications in the tab" do
|
|
|
|
Jobs.run_immediately!
|
|
|
|
|
|
|
|
mentionable_group = Fabricate(:group, mentionable_level: Group::ALIAS_LEVELS[:everyone])
|
|
|
|
user_in_mentionable_group = Fabricate(:user).tap { |user| mentionable_group.add(user) }
|
|
|
|
|
|
|
|
_post_with_group_mention =
|
|
|
|
PostCreator.create!(user, topic_id: topic.id, raw: "Hello @#{mentionable_group.name}")
|
|
|
|
|
|
|
|
sign_in(user_in_mentionable_group)
|
|
|
|
|
|
|
|
visit("/latest")
|
|
|
|
|
|
|
|
user_menu.open
|
|
|
|
|
|
|
|
expect(user_menu).to have_right_replies_button_count(1)
|
|
|
|
|
|
|
|
user_menu.click_replies_notifications_tab
|
|
|
|
|
|
|
|
expect(user_menu).to have_group_mentioned_notification(topic, user, mentionable_group)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|