From f11b82e6a8223f7fe6e6c7b7d7cf808909ffd434 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Sun, 22 Sep 2024 16:04:12 -0700 Subject: [PATCH] finish onboarding, wait for page to load --- spec/support/stories/profile_stories.rb | 1 + spec/system/profile_spec.rb | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/support/stories/profile_stories.rb b/spec/support/stories/profile_stories.rb index cad06a17e57426..45c02875a28aab 100644 --- a/spec/support/stories/profile_stories.rb +++ b/spec/support/stories/profile_stories.rb @@ -55,6 +55,7 @@ def with_chupacabras_fancy_profile email: 'chupacabra@example.com', password: password, confirmed_at: confirmed_at, account: Fabricate(:account, username: 'chupacabra', note: 'I am gonna getcha!', account_css: @chupacabra_css) ) + Web::Setting.where(user: chupacabra).first_or_initialize(user: chupacabra).update!(data: { introductionVersion: 2018_12_16_044202 }) end def confirmed_at diff --git a/spec/system/profile_spec.rb b/spec/system/profile_spec.rb index b7763f219101a8..cb8e74285ed868 100644 --- a/spec/system/profile_spec.rb +++ b/spec/system/profile_spec.rb @@ -31,19 +31,20 @@ expect(subject).to have_content 'Changes successfully saved!' end - describe 'with JS', :js do + describe 'with JS', :js, :streaming do before do with_chupacabras_fancy_profile end it 'Can have custom account_css set' do visit account_path('chupacabra') + # wait for page to load... + page.find '.account__header' expect(subject.html).to have_content('background-color: red !important') - expect(subject).to have_xpath('//*[@id="account-css"]') visit account_path('bob') + page.find '.account__header' expect(subject.html).to have_no_content('background-color: red !important') - expect(subject).to have_no_xpath('//*[@id="account-css"]') end end end