Skip to content

Commit

Permalink
type: remove all ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shervinchen committed Nov 10, 2024
1 parent 5a30154 commit b53ad96
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
7 changes: 4 additions & 3 deletions packages/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ const Checkbox: FC<PropsWithChildren<CheckboxProps>> = ({
}, [internalValue, inGroup, groupValue, checkboxValue]);

const setIndeterminate = useCallback(() => {
const checkBox = checkboxRef.current as HTMLInputElement;
if (indeterminate) {
checkboxRef.current!.indeterminate = true;
} else if (checkboxRef.current!.indeterminate) {
checkboxRef.current!.indeterminate = false;
checkBox.indeterminate = true;
} else if (checkBox.indeterminate) {
checkBox.indeterminate = false;
}
}, [indeterminate]);

Expand Down
17 changes: 10 additions & 7 deletions packages/Grid/__tests__/Grid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Grid', () => {
test('should match the snapshot', () => {
const { asFragment } = render(
<Grid>
<Grid.Col>
<Grid.Col span={24}>
<div>col</div>
</Grid.Col>
</Grid>
Expand All @@ -18,7 +18,7 @@ describe('Grid', () => {
test('should support custom class name', () => {
render(
<Grid className="custom-grid">
<Grid.Col className="custom-grid-col">
<Grid.Col span={24} className="custom-grid-col">
<div>col</div>
</Grid.Col>
</Grid>
Expand Down Expand Up @@ -115,7 +115,7 @@ describe('Grid', () => {
test('should support set regular align items', () => {
render(
<Grid align="top">
<Grid.Col>
<Grid.Col span={24}>
<div>col</div>
</Grid.Col>
</Grid>
Expand All @@ -137,7 +137,7 @@ describe('Grid', () => {
xxl: 'normal',
}}
>
<Grid.Col>
<Grid.Col span={24}>
<div>col</div>
</Grid.Col>
</Grid>
Expand All @@ -150,7 +150,7 @@ describe('Grid', () => {
test('should support set regular justify content', () => {
render(
<Grid justify="start">
<Grid.Col>
<Grid.Col span={24}>
<div>col</div>
</Grid.Col>
</Grid>
Expand All @@ -172,7 +172,7 @@ describe('Grid', () => {
xxl: 'space-evenly',
}}
>
<Grid.Col>
<Grid.Col span={24}>
<div>col</div>
</Grid.Col>
</Grid>
Expand Down Expand Up @@ -249,7 +249,10 @@ describe('Grid', () => {
test('should support set responsive offset of grid col', () => {
render(
<Grid>
<Grid.Col offset={{ xs: 2, sm: 8, md: 4, lg: 10, xl: 6, xxl: 6 }}>
<Grid.Col
span={24}
offset={{ xs: 2, sm: 8, md: 4, lg: 10, xl: 6, xxl: 6 }}
>
<div>col</div>
</Grid.Col>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion packages/Grid/__tests__/__snapshots__/Grid.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`Grid should match the snapshot 1`] = `
data-testid="grid"
>
<div
class="jsx-125401513 raw-grid-col raw-grid-col-span raw-grid-col-offset raw-grid-col-order raw-grid-gutter-horizontal"
class="jsx-2108396841 raw-grid-col raw-grid-col-span raw-grid-col-offset raw-grid-col-order raw-grid-gutter-horizontal"
data-testid="gridCol"
>
<div>
Expand Down
2 changes: 1 addition & 1 deletion packages/Select/__tests__/Select.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, act } from 'react';
import React, { useState } from 'react';
import { fireEvent, render, renderHook, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import Select from '..';
Expand Down

0 comments on commit b53ad96

Please sign in to comment.