mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 12:13:58 -06:00
a64cb948ed
There is a problem that unread and new count is not updated to reflecting topicTrackingState. It is because discourseComputed on Category is not working properly with topicTrackingState. Moving it to component level is making counter reliable.
23 lines
677 B
Ruby
23 lines
677 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Viewing top topics on categories page", type: :system, js: true do
|
|
fab!(:user) { Fabricate(:user) }
|
|
let(:category_list) { PageObjects::Components::CategoryList.new }
|
|
fab!(:category) { Fabricate(:category) }
|
|
fab!(:topic) { Fabricate(:topic, category: category) }
|
|
|
|
it "displays and updates new counter" do
|
|
sign_in(user)
|
|
|
|
visit("/categories")
|
|
|
|
category_list.click_new_posts_badge(count: 1)
|
|
category_list.click_topic(topic)
|
|
category_list.click_logo
|
|
category_list.click_category_navigation
|
|
|
|
expect(category_list).to have_category(category)
|
|
expect(category_list).to have_no_new_posts_badge
|
|
end
|
|
end
|