Commit 4480ea1f authored by Alper Akgun's avatar Alper Akgun

JS error on continuous onboarding welcome page

Changelog: fixed
EE: true
parent 1b36def8
......@@ -6,10 +6,16 @@ const emailUpdatesForm = document.querySelector('.js-email-opt-in');
const setupForCompany = document.querySelector('.js-setup-for-company');
const setupForMe = document.querySelector('.js-setup-for-me');
setupForCompany.addEventListener('change', () => {
emailUpdatesForm.classList.add('hidden');
});
if (emailUpdatesForm) {
if (setupForCompany) {
setupForCompany.addEventListener('change', () => {
emailUpdatesForm.classList.add('hidden');
});
}
setupForMe.addEventListener('change', () => {
emailUpdatesForm.classList.remove('hidden');
});
if (setupForMe) {
setupForMe.addEventListener('change', () => {
emailUpdatesForm.classList.remove('hidden');
});
}
}
......@@ -11,7 +11,7 @@ RSpec.describe 'User sees new onboarding flow', :js do
visit users_sign_up_welcome_path
end
it 'shows the expected pages' do
def common_flow
expect(page).to have_content('Welcome to GitLab')
expect(page).to have_content('Your profile Your GitLab group Your first project')
expect(page).to have_css('li.current', text: 'Your profile')
......@@ -38,14 +38,29 @@ RSpec.describe 'User sees new onboarding flow', :js do
expect(page).to have_field('project_path', with: 'test')
click_on 'Create project'
end
it 'shows onboarding flow pages' do
common_flow
expect(page).to have_content('Welcome to the guided GitLab tour')
Sidekiq::Worker.drain_all
click_on 'Show me the basics'
expect(page).to have_content('Learn GitLab')
expect(page).to have_css('.selectable', text: 'Label = ~Novice')
end
context 'continuous onboarding experiment enabled' do
before do
stub_experiment_for_subject(learn_gitlab_a: true, learn_gitlab_b: true)
end
it 'shows continuous onboarding flow pages' do
common_flow
expect(page).to have_content('Get started with GitLab')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment