refactor(spec): wait for debounce and in flight promise

This commit is contained in:
simon lehericey 2022-10-14 17:08:04 +02:00
parent 5cadb70d3a
commit e71b7eeee5

View file

@ -174,7 +174,8 @@ module SystemHelpers
def wait_for_autosave(brouillon = true)
blur
expect(page).to have_css('span', text: "#{brouillon ? 'Brouillon' : 'Dossier'} enregistré", visible: true)
expect(page).to have_css('.debounced-empty') # no more debounce
expect(page).to have_css('.autosave-state-idle') # no more in flight promise
page.execute_script("document.documentElement.dispatchEvent(new CustomEvent('autosave:reset'));")
end
end