Skip to content

Commit

Permalink
test: add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Oct 17, 2024
1 parent ca54a68 commit bfa5aae
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions e2e/base/fields/DateRangePicker.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,39 @@ context('With time inputs', () => {
outputShouldBe(['2023-12-11T13:34:00.000Z', '2024-01-08T23:56:59.000Z'])
})
})

context('With default times as full day', () => {
beforeEach(() => {
mountAndWait(
<StoryBox>
<DateRangePickerStory {...(Meta.args as any)} hasFullDayDefaultValue withTime />
</StoryBox>
)
})

it('Should fill, change and clear the date range', () => {
cy.get('input[aria-label="Jour de début"]').type('01')

outputShouldBe(undefined)

cy.get('input[aria-label="Mois de début"]').type('02')

outputShouldBe(undefined)

cy.get('input[aria-label="Année de début"]').type('2023')

outputShouldBe(undefined)

cy.get('input[aria-label="Jour de fin"]').type('03')

outputShouldBe(undefined)

cy.get('input[aria-label="Mois de fin"]').type('04')

outputShouldBe(undefined)

cy.get('input[aria-label="Année de fin"]').type('2024')

outputShouldBe(['2023-02-01T00:00:00.000Z', '2024-04-03T23:59:59.000Z'])
})
})

0 comments on commit bfa5aae

Please sign in to comment.