Skip to content

Commit

Permalink
Update and add table history navigation spec
Browse files Browse the repository at this point in the history
  • Loading branch information
sfnelson committed Aug 14, 2023
1 parent 30a4300 commit 788bbb4
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 78 deletions.
156 changes: 79 additions & 77 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,47 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.6)
actionpack (= 7.0.6)
activesupport (= 7.0.6)
actioncable (7.0.7)
actionpack (= 7.0.7)
activesupport (= 7.0.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.6)
actionpack (= 7.0.6)
activejob (= 7.0.6)
activerecord (= 7.0.6)
activestorage (= 7.0.6)
activesupport (= 7.0.6)
actionmailbox (7.0.7)
actionpack (= 7.0.7)
activejob (= 7.0.7)
activerecord (= 7.0.7)
activestorage (= 7.0.7)
activesupport (= 7.0.7)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.6)
actionpack (= 7.0.6)
actionview (= 7.0.6)
activejob (= 7.0.6)
activesupport (= 7.0.6)
actionmailer (7.0.7)
actionpack (= 7.0.7)
actionview (= 7.0.7)
activejob (= 7.0.7)
activesupport (= 7.0.7)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.6)
actionview (= 7.0.6)
activesupport (= 7.0.6)
actionpack (7.0.7)
actionview (= 7.0.7)
activesupport (= 7.0.7)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.6)
actionpack (= 7.0.6)
activerecord (= 7.0.6)
activestorage (= 7.0.6)
activesupport (= 7.0.6)
actiontext (7.0.7)
actionpack (= 7.0.7)
activerecord (= 7.0.7)
activestorage (= 7.0.7)
activesupport (= 7.0.7)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.6)
activesupport (= 7.0.6)
actionview (7.0.7)
activesupport (= 7.0.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -69,31 +69,32 @@ GEM
activemodel (>= 5.2.0)
activestorage (>= 5.2.0)
activesupport (>= 5.2.0)
activejob (7.0.6)
activesupport (= 7.0.6)
activejob (7.0.7)
activesupport (= 7.0.7)
globalid (>= 0.3.6)
activemodel (7.0.6)
activesupport (= 7.0.6)
activerecord (7.0.6)
activemodel (= 7.0.6)
activesupport (= 7.0.6)
activestorage (7.0.6)
actionpack (= 7.0.6)
activejob (= 7.0.6)
activerecord (= 7.0.6)
activesupport (= 7.0.6)
activemodel (7.0.7)
activesupport (= 7.0.7)
activerecord (7.0.7)
activemodel (= 7.0.7)
activesupport (= 7.0.7)
activestorage (7.0.7)
actionpack (= 7.0.7)
activejob (= 7.0.7)
activerecord (= 7.0.7)
activesupport (= 7.0.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.6)
activesupport (7.0.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.4)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
android_key_attestation (0.3.0)
ast (2.4.2)
awrence (1.2.1)
base64 (0.1.1)
bcrypt (3.1.19)
better_html (2.0.2)
actionview (>= 6.0)
Expand Down Expand Up @@ -144,7 +145,7 @@ GEM
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faker (3.2.0)
faker (3.2.1)
i18n (>= 1.8.11, < 2)
ferrum (0.13)
addressable (~> 2.5)
Expand All @@ -153,9 +154,9 @@ GEM
websocket-driver (>= 0.6, < 0.8)
globalid (1.1.0)
activesupport (>= 5.0)
google-protobuf (3.23.4-aarch64-linux)
google-protobuf (3.23.4-arm64-darwin)
google-protobuf (3.23.4-x86_64-linux)
google-protobuf (3.24.0-aarch64-linux)
google-protobuf (3.24.0-arm64-darwin)
google-protobuf (3.24.0-x86_64-linux)
govuk_design_system_formbuilder (4.1.1)
actionview (>= 6.1)
activemodel (>= 6.1)
Expand All @@ -181,9 +182,9 @@ GEM
activesupport (>= 3)
redis (>= 3)
redlock (>= 1.2)
katalyst-kpop (2.0.4)
katalyst-navigation (1.4.0)
katalyst-tables (2.1.2)
katalyst-kpop (2.0.8)
katalyst-navigation (1.4.1)
katalyst-tables (2.1.3)
html-attributes-utils
view_component
language_server-protocol (3.17.0.3)
Expand All @@ -198,7 +199,7 @@ GEM
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_mime (1.1.5)
minitest (5.19.0)
net-imap (0.3.7)
date
Expand All @@ -210,11 +211,11 @@ GEM
net-smtp (0.3.3)
net-protocol
nio4r (2.5.9)
nokogiri (1.15.3-aarch64-linux)
nokogiri (1.15.4-aarch64-linux)
racc (~> 1.4)
nokogiri (1.15.3-arm64-darwin)
nokogiri (1.15.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.3-x86_64-linux)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
openssl (3.1.0)
openssl-signature_algorithm (1.3.0)
Expand All @@ -228,54 +229,54 @@ GEM
puma (6.3.0)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.7)
rack (2.2.8)
rack-test (2.1.0)
rack (>= 1.3)
rack_session_access (0.2.0)
builder (>= 2.0.0)
rack (>= 1.0.0)
rails (7.0.6)
actioncable (= 7.0.6)
actionmailbox (= 7.0.6)
actionmailer (= 7.0.6)
actionpack (= 7.0.6)
actiontext (= 7.0.6)
actionview (= 7.0.6)
activejob (= 7.0.6)
activemodel (= 7.0.6)
activerecord (= 7.0.6)
activestorage (= 7.0.6)
activesupport (= 7.0.6)
rails (7.0.7)
actioncable (= 7.0.7)
actionmailbox (= 7.0.7)
actionmailer (= 7.0.7)
actionpack (= 7.0.7)
actiontext (= 7.0.7)
actionview (= 7.0.7)
activejob (= 7.0.7)
activemodel (= 7.0.7)
activerecord (= 7.0.7)
activestorage (= 7.0.7)
activesupport (= 7.0.7)
bundler (>= 1.15.0)
railties (= 7.0.6)
railties (= 7.0.7)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.1.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.6)
actionpack (= 7.0.6)
activesupport (= 7.0.6)
railties (7.0.7)
actionpack (= 7.0.7)
activesupport (= 7.0.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
redis (5.0.6)
redis (5.0.7)
redis-client (>= 0.9.0)
redis-client (0.14.1)
connection_pool
redlock (2.0.2)
redis-client (~> 0.14.1)
regexp_parser (2.8.1)
rexml (3.2.5)
rexml (3.2.6)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
Expand All @@ -293,7 +294,8 @@ GEM
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.1)
rubocop (1.55.0)
rubocop (1.56.0)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -316,7 +318,7 @@ GEM
rubocop-rails
rubocop-rake
rubocop-rspec
rubocop-performance (1.18.0)
rubocop-performance (1.19.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.20.2)
Expand All @@ -325,18 +327,18 @@ GEM
rubocop (>= 1.33.0, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.22.0)
rubocop-rspec (2.23.2)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
safety_net_attestation (0.4.0)
jwt (~> 2.0)
sass-embedded (1.64.1-aarch64-linux-gnu)
sass-embedded (1.64.2-aarch64-linux-gnu)
google-protobuf (~> 3.23)
sass-embedded (1.64.1-arm64-darwin)
sass-embedded (1.64.2-arm64-darwin)
google-protobuf (~> 3.23)
sass-embedded (1.64.1-x86_64-linux-gnu)
sass-embedded (1.64.2-x86_64-linux-gnu)
google-protobuf (~> 3.23)
sentry-rails (5.10.0)
railties (>= 5.0)
Expand All @@ -356,7 +358,7 @@ GEM
sqlite3 (1.6.3-aarch64-linux)
sqlite3 (1.6.3-arm64-darwin)
sqlite3 (1.6.3-x86_64-linux)
stimulus-rails (1.2.1)
stimulus-rails (1.2.2)
railties (>= 6.0.0)
thor (1.2.2)
timeout (0.4.0)
Expand Down Expand Up @@ -394,7 +396,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.9)
zeitwerk (2.6.11)

PLATFORMS
aarch64-linux
Expand Down
21 changes: 20 additions & 1 deletion spec/system/index/filtering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,26 @@
click_on "Title"

expect(page).to have_current_path("/admin/posts?sort=title+asc&search=#{query}")
expect(page).to have_css("input[type=search][value=#{query}")
expect(page).to have_css("input[type=search][value=#{query}]")
end
end

context "with history navigation" do
it "restores search state" do
visit "/admin/posts"

fill_in "Search", with: query

expect(page).to have_current_path("/admin/posts?search=#{query}")

click_on "Dashboard" # leave the page with turbo

expect(page).to have_selector("h1", text: "Dashboard")

page.go_back

expect(page).to have_current_path("/admin/posts?search=#{query}")
expect(page).to have_css("input[type=search][value=#{query}]")
end
end
end

0 comments on commit 788bbb4

Please sign in to comment.