From 4c130ff5356cd211d09ed08764617f71665644d5 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Tue, 26 Jan 2021 13:25:56 +0100 Subject: [PATCH] add test case --- .../StaticDateRangePicker.test.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/material-ui-lab/src/StaticDateRangePicker/StaticDateRangePicker.test.tsx b/packages/material-ui-lab/src/StaticDateRangePicker/StaticDateRangePicker.test.tsx index 7375778f11931f..815f5473e7fbeb 100644 --- a/packages/material-ui-lab/src/StaticDateRangePicker/StaticDateRangePicker.test.tsx +++ b/packages/material-ui-lab/src/StaticDateRangePicker/StaticDateRangePicker.test.tsx @@ -35,4 +35,22 @@ describe('', () => { ), ).to.have.length(31); }); + + it('should render the correct a11y tree structure', () => { + render( + {}} + 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'); + }); });