Skip to content

Commit

Permalink
add a spec
Browse files Browse the repository at this point in the history
  • Loading branch information
CvX committed Nov 29, 2024
1 parent d50a0ec commit 2bd56e7
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec/system/disable_sort_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

describe "Disabling topic list sorting", type: :system do
fab!(:category)
let(:category_page) { PageObjects::Pages::Category.new }

before do
SiteSetting.calendar_enabled = true
Fabricate.times(2, :topic, category:)
end

it "disables the ability to sort topic list columns" do
category_page.visit(category)
expect(find("th.activity")).to match_selector(".sortable")

category.custom_fields["disable_topic_resorting"] = true
page.refresh
expect(find("th.activity")).to match_selector(".sortable")

SiteSetting.disable_resorting_on_categories_enabled = true
page.refresh
expect(find("th.activity")).to_not match_selector(".sortable")
end
end

0 comments on commit 2bd56e7

Please sign in to comment.