Skip to content

Commit 3fd1d6f

Browse files
test: Fix linting issues
1 parent 1bc224d commit 3fd1d6f

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

packages/@react-spectrum/datepicker/test/DateField.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
import {act, pointerMap, fireEvent, render as render_, within} from '@react-spectrum/test-utils-internal';
13+
import {act, pointerMap, render as render_, within} from '@react-spectrum/test-utils-internal';
1414
import {Button} from '@react-spectrum/button';
1515
import {CalendarDate, CalendarDateTime, ZonedDateTime} from '@internationalized/date';
1616
import {DateField} from '../';

packages/@react-spectrum/datepicker/test/DatePicker.test.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ describe('DatePicker', function () {
10171017
expect(segments[2]).toHaveFocus();
10181018
});
10191019

1020-
//This test should be reviewed
1020+
// This test should be reviewed
10211021
it('should focus the button when the era is removed', async function () {
10221022
let {getByTestId, queryByTestId, getByRole} = render(<DatePicker label="Date" defaultValue={new CalendarDate('BC', 2020, 2, 3)} />);
10231023
let field = getByTestId('date-field');
@@ -1027,14 +1027,14 @@ describe('DatePicker', function () {
10271027
act(() => era.focus());
10281028
await user.keyboard('{ArrowUp}');
10291029

1030-
const button = getByRole('button')
1030+
const button = getByRole('button');
10311031
act(() => button.focus());
10321032

10331033
expect(queryByTestId('era')).toBeNull();
10341034
expect(document.activeElement).toBe(button);
10351035
});
10361036

1037-
//This test should be reviewed
1037+
// This test should be reviewed
10381038
it('should focus the button when the era is removed and is the first segment', async function () {
10391039
let {getByTestId, queryByTestId, getByRole} = render(
10401040
<Provider theme={theme} locale="lv-LV">
@@ -1048,7 +1048,7 @@ describe('DatePicker', function () {
10481048
act(() => era.focus());
10491049
await user.keyboard('{ArrowUp}');
10501050

1051-
const button = getByRole('button')
1051+
const button = getByRole('button');
10521052
act(() => button.focus());
10531053
expect(queryByTestId('era')).toBeNull();
10541054
expect(document.activeElement).toBe(button);
@@ -1072,7 +1072,7 @@ describe('DatePicker', function () {
10721072
let onChange = jest.fn();
10731073

10741074
// Test controlled mode
1075-
let {getByLabelText, unmount, getByRole} = render(
1075+
let {getByLabelText, unmount} = render(
10761076
<Provider theme={theme} locale={options?.locale}>
10771077
<DatePicker label="Date" value={value} onChange={onChange} {...options.props} />
10781078
</Provider>
@@ -1351,8 +1351,8 @@ describe('DatePicker', function () {
13511351
expect(segment).toHaveFocus();
13521352
}
13531353

1354-
let button = getByRole('button')
1355-
act (() => button.focus())
1354+
let button = getByRole('button');
1355+
act(() => button.focus());
13561356
expect(onChange).toHaveBeenCalledWith(newValue);
13571357
expect(segment.textContent).toBe(textContent);
13581358

@@ -1369,7 +1369,6 @@ describe('DatePicker', function () {
13691369
textContent = segment.textContent;
13701370
act(() => {segment.focus();});
13711371

1372-
count = 0;
13731372
for (let [i, key] of [...keys].entries()) {
13741373
beforeInput(segment, key);
13751374

@@ -1390,8 +1389,8 @@ describe('DatePicker', function () {
13901389
expect(segment).toHaveFocus();
13911390
}
13921391

1393-
button = getByRole('button')
1394-
act (() => button.focus())
1392+
button = getByRole('button');
1393+
act(() => button.focus());
13951394
expect(onChange).toHaveBeenCalledWith(newValue);
13961395
expect(segment.textContent).not.toBe(textContent);
13971396

@@ -1550,7 +1549,7 @@ describe('DatePicker', function () {
15501549
act(() => {segment.focus();});
15511550

15521551
await user.keyboard('{Backspace}');
1553-
let button = getByRole('button')
1552+
let button = getByRole('button');
15541553
act(() => {button.focus();});
15551554
expect(onChange).toHaveBeenCalledTimes(1);
15561555
expect(onChange).toHaveBeenCalledWith(newValue);
@@ -1565,7 +1564,7 @@ describe('DatePicker', function () {
15651564
act(() => {segment.focus();});
15661565

15671566
await user.keyboard('{Backspace}');
1568-
button = getByRole('button')
1567+
button = getByRole('button');
15691568
act(() => {button.focus();});
15701569
expect(onChange).toHaveBeenCalledTimes(1);
15711570
expect(onChange).toHaveBeenCalledWith(newValue);
@@ -1640,7 +1639,7 @@ describe('DatePicker', function () {
16401639
act(() => {segment.focus();});
16411640

16421641
await user.keyboard('{Backspace}');
1643-
await user.tab()
1642+
await user.tab();
16441643
expect(onChange).toHaveBeenCalledTimes(1);
16451644
expect(onChange).toHaveBeenCalledWith(new CalendarDate(201, 2, 3));
16461645
expect(segment).toHaveTextContent('٢٠١');
@@ -1661,13 +1660,13 @@ describe('DatePicker', function () {
16611660
let year = getByLabelText('year,');
16621661
act(() => year.focus());
16631662
await user.keyboard('{ArrowDown}');
1664-
await user.tab()
1663+
await user.tab();
16651664

16661665
expect(getByTestId('invalid-icon')).toBeVisible();
16671666

16681667
act(() => year.focus());
16691668
await user.keyboard('{ArrowUp}');
1670-
await user.tab()
1669+
await user.tab();
16711670
expect(queryByTestId('invalid-icon')).toBeNull();
16721671
});
16731672

@@ -1828,7 +1827,7 @@ describe('DatePicker', function () {
18281827
expect(onChange).toHaveBeenCalledTimes(0);
18291828
beforeInput(document.activeElement, '0');
18301829
expect(segments[2]).toHaveFocus();
1831-
await user.tab()
1830+
await user.tab();
18321831
expect(onChange).toHaveBeenCalledTimes(1);
18331832
value = new CalendarDate(2020, 4, 5);
18341833
expect(onChange).toHaveBeenCalledWith(value);

packages/@react-spectrum/datepicker/test/TimeField.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ describe('TimeField', function () {
522522

523523
describe('validationBehavior=aria', () => {
524524
it('supports minValue and maxValue', async () => {
525-
let {getByRole, getByLabelText} = render(
525+
let {getByRole} = render(
526526
<Provider theme={theme}>
527527
<Form data-testid="form">
528528
<TimeField label="Date" name="date" minValue={new Time(9)} maxValue={new Time(17)} defaultValue={new Time(8)} />

0 commit comments

Comments
 (0)