Commit e4694412 authored by Stan Hu's avatar Stan Hu

Fix flaky user_manages_subscription_spec.rb

It looks like the feature spec was attempting to click on the
subscription button before all the Ajax calls for the page had
loaded. As a result, the click did nothing, and the test failed.

To fix this, we should wait for outstanding requests to be ready before
attempting to click.

Closes https://gitlab.com/gitlab-org/gitlab/issues/207835
parent 87bab3bd
......@@ -16,6 +16,8 @@ describe 'User manages subscription', :js do
it 'toggles subscription' do
page.within('.js-issuable-subscribe-button') do
wait_for_requests
expect(page).to have_css 'button:not(.is-checked)'
find('button:not(.is-checked)').click
......
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