Skip to content

Commit 18aaa6f

Browse files
committed
test: remove redundant focusableRef tests in DatePicker and DateField
1 parent e1058df commit 18aaa6f

File tree

2 files changed

+0
-55
lines changed

2 files changed

+0
-55
lines changed

packages/react-aria-components/test/DateField.test.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -491,23 +491,7 @@ describe('DateField', () => {
491491
);
492492

493493
let segments = getAllByRole('spinbutton');
494-
// focusableRef should point to the first editable segment (month in en-US)
495494
expect(focusableRef.current).toBe(segments[0]);
496-
});
497-
498-
it('should focus first segment when calling focus() on focusableRef', () => {
499-
let focusableRef = React.createRef();
500-
let {getAllByRole} = render(
501-
<DateField>
502-
<Label>Birth date</Label>
503-
<DateInput focusableRef={focusableRef}>
504-
{segment => <DateSegment segment={segment} />}
505-
</DateInput>
506-
</DateField>
507-
);
508-
509-
let segments = getAllByRole('spinbutton');
510-
expect(document.activeElement).not.toBe(segments[0]);
511495

512496
// Programmatically focus the first segment
513497
act(() => {
@@ -516,23 +500,4 @@ describe('DateField', () => {
516500

517501
expect(document.activeElement).toBe(segments[0]);
518502
});
519-
520-
it('should support focusableRef with different locales', () => {
521-
let focusableRef = React.createRef();
522-
let {getAllByRole} = render(
523-
<I18nProvider locale="zh-CN">
524-
<DateField>
525-
<Label>Birth date</Label>
526-
<DateInput focusableRef={focusableRef}>
527-
{segment => <DateSegment segment={segment} />}
528-
</DateInput>
529-
</DateField>
530-
</I18nProvider>
531-
);
532-
533-
let segments = getAllByRole('spinbutton');
534-
// In zh-CN, year comes first
535-
expect(focusableRef.current).toBe(segments[0]);
536-
expect(segments[0]).toHaveAttribute('data-type', 'year');
537-
});
538503
});

packages/react-aria-components/test/DatePicker.test.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -351,27 +351,7 @@ describe('DatePicker', () => {
351351

352352
let group = getByRole('group');
353353
let segments = within(group).getAllByRole('spinbutton');
354-
// focusableRef should point to the first editable segment
355354
expect(focusableRef.current).toBe(segments[0]);
356-
});
357-
358-
it('should focus first segment when calling focus() on focusableRef', () => {
359-
let focusableRef = React.createRef();
360-
let {getByRole} = render(
361-
<DatePicker>
362-
<Label>Birth date</Label>
363-
<Group>
364-
<DateInput focusableRef={focusableRef}>
365-
{(segment) => <DateSegment segment={segment} />}
366-
</DateInput>
367-
<Button></Button>
368-
</Group>
369-
</DatePicker>
370-
);
371-
372-
let group = getByRole('group');
373-
let segments = within(group).getAllByRole('spinbutton');
374-
expect(document.activeElement).not.toBe(segments[0]);
375355

376356
// Programmatically focus the first segment
377357
act(() => {

0 commit comments

Comments
 (0)