Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 26, 2021
1 parent cac6898 commit 4c130ff
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,22 @@ describe('<StaticDateRangePicker />', () => {
),
).to.have.length(31);
});

it('should render the correct a11y tree structure', () => {
render(
<StaticDateRangePicker
renderInput={defaultRangeRenderInput}
onChange={() => {}}
value={[
adapterToUse.date('2018-01-01T00:00:00.000'),
adapterToUse.date('2018-01-31T00:00:00.000'),
]}
/>,
);

// It should follow https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html
expect(
document.querySelector('[role="grid"] > [role="row"] [role="cell"] > button'),
).to.have.text('1');
});
});

0 comments on commit 4c130ff

Please sign in to comment.