Skip to content

Commit

Permalink
update date picker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuli committed Dec 12, 2024
1 parent 0e8ca1f commit f711ba8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const translations: Translations = {
validDate: 'Invalid date',
dateTooEarly: 'Date too early',
dateTooLate: 'Date too late'
}
},
open: 'Open date picker',
close: 'Close date picker'
}
}

Expand All @@ -38,7 +40,7 @@ describe('DatePicker', () => {
</TestContextProvider>
)
const get = () =>
screen.getByRole('textbox', { description: 'Date picker description' })
screen.getByRole('textbox', { name: 'Date picker description' })

it('attributes', () => {
render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const translations: Translations = {
validDate: 'Invalid date',
dateTooEarly: 'Date too early',
dateTooLate: 'Date too late'
}
},
open: 'Open date picker',
close: 'Close date picker'
}
}

Expand All @@ -44,7 +46,7 @@ describe('DateRangePicker', () => {
)

const [start, end] = screen.getAllByRole('textbox', {
description: 'Date picker description'
name: 'Date picker description'
})
expect(start).toHaveAttribute('placeholder', 'Placeholder')
expect(end).toHaveAttribute('placeholder', 'Placeholder')
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/lib-components/utils/TestContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export const testTranslations: Translations = {
validDate: '',
dateTooEarly: '',
dateTooLate: ''
}
},
open: '',
close: ''
},
documentTemplates: {
templateQuestions: {
Expand Down

0 comments on commit f711ba8

Please sign in to comment.