feat(inputs): ✨ Add Date input
This commit is contained in:
@ -137,6 +137,41 @@ describe('URL input', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Date input', () => {
|
||||
beforeEach(() => {
|
||||
cy.task('seed')
|
||||
createTypebotWithStep({ type: InputStepType.DATE })
|
||||
cy.signOut()
|
||||
})
|
||||
|
||||
it.only('options should work', () => {
|
||||
cy.signIn('test2@gmail.com')
|
||||
cy.visit('/typebots/typebot3/edit')
|
||||
cy.findByRole('button', { name: 'Preview' }).click()
|
||||
getIframeBody()
|
||||
.findByTestId('from-date')
|
||||
.should('have.attr', 'type')
|
||||
.should('eq', 'date')
|
||||
getIframeBody().findByRole('button', { name: 'Send' }).should('be.disabled')
|
||||
cy.findByTestId('step-step1').click({ force: true })
|
||||
cy.findByRole('checkbox', { name: 'Is range?' }).check({ force: true })
|
||||
cy.findByRole('textbox', { name: 'From label:' }).clear().type('Previous:')
|
||||
cy.findByRole('textbox', { name: 'To label:' }).clear().type('After:')
|
||||
cy.findByRole('checkbox', { name: 'With time?' }).check({ force: true })
|
||||
cy.findByRole('textbox', { name: 'Button label:' }).clear().type('Go')
|
||||
cy.findByRole('button', { name: 'Restart' }).click()
|
||||
getIframeBody()
|
||||
.findByTestId('from-date')
|
||||
.should('have.attr', 'type')
|
||||
.should('eq', 'datetime-local')
|
||||
getIframeBody()
|
||||
.findByTestId('to-date')
|
||||
.should('have.attr', 'type')
|
||||
.should('eq', 'datetime-local')
|
||||
getIframeBody().findByRole('button', { name: 'Go' })
|
||||
})
|
||||
})
|
||||
|
||||
const createTypebotWithStep = (step: Omit<InputStep, 'id' | 'blockId'>) => {
|
||||
cy.task(
|
||||
'createTypebot',
|
||||
|
Reference in New Issue
Block a user