discourse/spec/system/nested_activity_log_spec.rb

29 lines
895 B
Ruby

# frozen_string_literal: true
RSpec.describe "Nested activity log" do
fab!(:admin)
fab!(:topic) { Fabricate(:topic, user: admin) }
fab!(:op) { Fabricate(:post, topic: topic, user: admin, post_number: 1) }
before do
SiteSetting.nested_replies_enabled = true
sign_in(admin)
end
it "opens the activity log modal and lists small actions" do
topic.add_small_action(admin, "closed.enabled")
page.visit("/n/#{topic.slug}/#{topic.id}")
find(".nested-view__activity-link").click
expect(page).to have_css(".nested-activity-log-modal")
expect(page).to have_css(".nested-activity-log-modal__item", count: 2)
end
it "hides the activity log link on a topic with no small actions" do
page.visit("/n/#{topic.slug}/#{topic.id}")
expect(page).to have_css(".nested-view__controls")
expect(page).to have_no_css(".nested-view__activity-link")
end
end