Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Sep 26, 2024
1 parent 5984ccd commit 5c5d382
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/system/avo/tabs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

RSpec.describe "Tabs", type: :system do
let!(:user) { create :user, birthday: "10.02.1988" }
let!(:projects) {create_list :project, 9, users: [user]}

describe "doesn't display tabs content" do
context "on index" do
Expand Down Expand Up @@ -172,4 +173,25 @@
find('a[data-selected="false"][data-tabs-tab-name-param="Created at"]').click
expect(page).not_to have_text 'Invalid DateTime'
end

it "keeps the pagination on tab when back is used" do
visit avo.resources_user_path user

find('a[data-selected="false"][data-tabs-tab-name-param="Projects"]').click
expect(page).to have_css('a.current[role="link"][aria-disabled="true"][aria-current="page"]', text: '1')
expect(page).to have_text "Displaying items 1-8 of 9 in total"

find('a[data-turbo-frame="has_and_belongs_to_many_field_show_projects"]', text: '2').click
expect(page).to have_css('a.current[role="link"][aria-disabled="true"][aria-current="page"]', text: '2')
expect(page).to have_text "Displaying items 9-9 of 9 in total"

find('a[aria-label="View project"]').click
wait_for_loaded

page.go_back
wait_for_loaded

expect(page).to have_css('a.current[role="link"][aria-disabled="true"][aria-current="page"]', text: '2')
expect(page).to have_text "Displaying items 9-9 of 9 in total"
end
end

0 comments on commit 5c5d382

Please sign in to comment.