Skip to content

Commit

Permalink
Refactor test:
Browse files Browse the repository at this point in the history
- Add ruby test for *nav_js helper with keyset_for_ui
- Add e2e test for keyset_for_ui
- Use pagy.js in all apps
- Skip data-pagy and hrefs from the snapshots
  • Loading branch information
ddnexus committed Jan 3, 2025
1 parent 6b47de4 commit e66262e
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 187 deletions.
3 changes: 3 additions & 0 deletions test/helpers/nav_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def nav_js_tests(prefix) # e.g. pagy_bootstrap_nav_js
# raise Pagy::VariableError for missing 0 step
pagy = Pagy.new(count: 1000, page: 20, steps: { 0 => 5, 600 => 7 })
_ { app.send(method, pagy, steps: { 600 => 7 }) }.must_raise Pagy::VariableError
pagyk = Pagy::KeysetForUI.new(Pet.order(:animal, :name, :id),
page: ['key', 2, 2, ["cat", "Ella", 18], nil])
_(app.send(method, pagyk)).must_rematch :keyset
end

def nav_js_countless_tests(prefix) # e.g. pagy_bootstrap_nav_js
Expand Down
Loading

0 comments on commit e66262e

Please sign in to comment.