2
0

fix(tests): 💚 Fix e2e window reload bug

This commit is contained in:
Baptiste Arnaud
2022-01-08 08:38:39 +01:00
parent 47162cb28a
commit 8391bcce5e
5 changed files with 32 additions and 15 deletions

View File

@ -1,4 +1,7 @@
import { parseTestTypebot } from 'cypress/plugins/utils'
import {
parseTestTypebot,
preventUserFromRefreshing,
} from 'cypress/plugins/utils'
import { InputStep, InputStepType } from 'models'
describe('Text input', () => {
@ -8,6 +11,12 @@ describe('Text input', () => {
cy.signOut()
})
afterEach(() => {
cy.window().then((win) => {
win.removeEventListener('beforeunload', preventUserFromRefreshing)
})
})
it('options should work', () => {
cy.signIn('test2@gmail.com')
cy.visit('/typebots/typebot3/edit')
@ -71,7 +80,7 @@ describe('Email input', () => {
cy.signOut()
})
it.only('options should work', () => {
it('options should work', () => {
cy.signIn('test2@gmail.com')
cy.visit('/typebots/typebot3/edit')
cy.findByRole('button', { name: 'Preview' }).click()