Skip to content

Commit f0ea52f

Browse files
committed
test
1 parent c273e8b commit f0ea52f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

packages/x-date-pickers/src/AdapterMomentHijri/AdapterMomentHijri.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,21 @@ describe('<AdapterMomentHijri />', () => {
103103

104104
expectFieldValue(view.getSectionsContainer(), localizedTexts[localeKey].value);
105105
});
106+
107+
// The day value is rendered with localized (Arabic-Indic) digits.
108+
// `Number('٢٩')` returns `NaN`, so the digits must be converted back to
109+
// Latin digits before computing the `aria-*` attributes.
110+
// Regression test for https://github.com/mui/mui-x/issues/20355.
111+
it('should expose valid aria attributes with localized digits', () => {
112+
const view = renderWithProps({
113+
value: adapter.date(testDate),
114+
});
115+
116+
// The day section ("٢٩").
117+
const daySection = view.getSection(2);
118+
expect(daySection.getAttribute('aria-valuenow')).to.equal('29');
119+
expect(daySection.getAttribute('aria-valuetext')).to.equal('٢٩');
120+
});
106121
});
107122
});
108123
});

0 commit comments

Comments
 (0)