mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Stabilise spec by waiting for JS requests
Well, two seconds is just a guess. Ideally the page wouldn't display until we have everything loaded. But this logic will be replaced when we chuck out AngularJS. This version passed over 100 runs with a busy CPU on my machine.
This commit is contained in:
@@ -223,8 +223,16 @@ describe '
|
||||
|
||||
click_button 'Create'
|
||||
|
||||
expect(page).to have_select 'new_supplier_id'
|
||||
expect(page).not_to have_select 'new_supplier_id', with_options: [supplier_unmanaged.name]
|
||||
# Wait for API requests to finish:
|
||||
sleep 2
|
||||
|
||||
expect(page).to have_select 'new_supplier_id', with_options: [
|
||||
"Managed supplier",
|
||||
"Permitted supplier",
|
||||
]
|
||||
expect(page).not_to have_select 'new_supplier_id', with_options: [
|
||||
"Unmanaged supplier",
|
||||
]
|
||||
select 'Managed supplier', from: 'new_supplier_id'
|
||||
click_button 'Add supplier'
|
||||
select 'Permitted supplier', from: 'new_supplier_id'
|
||||
|
||||
Reference in New Issue
Block a user