DEV: Try fix flaky sidebar filter spec (#26797)

We were getting this error causing it to flake when
creating users:

```
ActiveRecord::StatementInvalid:
  PG::ReadOnlySqlTransaction: ERROR:  cannot execute INSERT in a read-only transaction
```
This commit is contained in:
Martin Brennan 2024-04-29 15:01:33 +10:00 committed by GitHub
parent 0bfa37eb2d
commit 79cccaf61f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -9,10 +9,12 @@ describe "Admin Revamp | Sidebar Navigation", type: :system do
let(:filter) { PageObjects::Components::Filter.new }
before do
SiteSetting.navigation_menu = "sidebar"
SiteSetting.admin_sidebar_enabled_groups = [
Group::AUTO_GROUPS[:admins],
Group::AUTO_GROUPS[:moderators],
]
sign_in(admin)
end
@ -106,6 +108,9 @@ describe "Admin Revamp | Sidebar Navigation", type: :system do
end
it "allows further filtering of site settings or users if links do not show results" do
user_1 = Fabricate(:user, username: "moltisanti", name: "Christopher Moltisanti")
user_2 = Fabricate(:user, username: "bevelaqua", name: "Matthew Bevelaqua")
visit("/admin")
filter.filter("user locale")
find(".sidebar-additional-filter-settings").click
@ -121,9 +126,6 @@ describe "Admin Revamp | Sidebar Navigation", type: :system do
)
expect(page).to have_content(I18n.t("site_settings.log_search_queries"))
user_1 = Fabricate(:user, username: "moltisanti", name: "Christopher Moltisanti")
user_2 = Fabricate(:user, username: "bevelaqua", name: "Matthew Bevelaqua")
filter.filter("bevelaqua")
find(".sidebar-additional-filter-users").click
expect(page).to have_current_path("/admin/users/list/active?username=bevelaqua")