diff --git a/components/affix/__tests__/Affix.test.tsx b/components/affix/__tests__/Affix.test.tsx index 211218d8b8..2bf977c87b 100644 --- a/components/affix/__tests__/Affix.test.tsx +++ b/components/affix/__tests__/Affix.test.tsx @@ -37,8 +37,8 @@ const AffixMounter: React.FC = (props) => { }; describe('Affix Render', () => { - rtlTest(Affix as any); - accessibilityTest(Affix as any); + rtlTest(() => test); + accessibilityTest(() => test); const domMock = jest.spyOn(HTMLElement.prototype, 'getBoundingClientRect'); diff --git a/components/affix/__tests__/__snapshots__/Affix.test.tsx.snap b/components/affix/__tests__/__snapshots__/Affix.test.tsx.snap index bd230c7ac4..b81cbc4bbb 100644 --- a/components/affix/__tests__/__snapshots__/Affix.test.tsx.snap +++ b/components/affix/__tests__/__snapshots__/Affix.test.tsx.snap @@ -4,6 +4,8 @@ exports[`Affix Render rtl render component should be rendered correctly in RTL d
+ > + test +
`; diff --git a/components/layout/__tests__/dynamic-breakpoint.test.tsx b/components/layout/__tests__/dynamic-breakpoint.test.tsx index 302c3636bf..efe362dffe 100644 --- a/components/layout/__tests__/dynamic-breakpoint.test.tsx +++ b/components/layout/__tests__/dynamic-breakpoint.test.tsx @@ -2,9 +2,10 @@ import React, { useState } from 'react'; import { fireEvent, render } from '../../../tests/utils'; import Sider from '../Sider'; +import type { Breakpoint } from '../..'; const Content = () => { - const [breakpoint, setBreakpoint] = useState('sm'); + const [breakpoint, setBreakpoint] = useState('sm'); const toggleBreakpoint = () => { if (breakpoint === 'sm') { setBreakpoint('lg'); @@ -13,7 +14,7 @@ const Content = () => { } }; return ( - + diff --git a/components/tag/__tests__/index.test.tsx b/components/tag/__tests__/index.test.tsx index ee07e70b16..9f67679dea 100644 --- a/components/tag/__tests__/index.test.tsx +++ b/components/tag/__tests__/index.test.tsx @@ -22,9 +22,9 @@ function waitRaf() { describe('Tag', () => { mountTest(Tag); - mountTest(Tag.CheckableTag as any); + mountTest(() => ); rtlTest(Tag); - rtlTest(Tag.CheckableTag as any); + rtlTest(() => ); beforeAll(() => { jest.useFakeTimers(); diff --git a/components/typography/__tests__/index.test.tsx b/components/typography/__tests__/index.test.tsx index 0a70fe8a05..fbc23ab0cb 100644 --- a/components/typography/__tests__/index.test.tsx +++ b/components/typography/__tests__/index.test.tsx @@ -131,18 +131,14 @@ describe('Typography', () => { expect(container.querySelector('.ant-tooltip-inner')?.textContent).toBe('Copy'); } else if (tooltips === false) { expect(container.querySelector('.ant-tooltip-inner')).toBeFalsy(); - } else if ((tooltips as any)[0] === '' && (tooltips as any)[1] === '') { + } else if (tooltips[0] === '' && tooltips[1] === '') { expect(container.querySelector('.ant-tooltip-inner')).toBeFalsy(); - } else if ((tooltips as any)[0] === '' && (tooltips as any)[1]) { + } else if (tooltips[0] === '' && tooltips[1]) { expect(container.querySelector('.ant-tooltip-inner')).toBeFalsy(); - } else if ((tooltips as any)[1] === '' && (tooltips as any)[0]) { - expect(container.querySelector('.ant-tooltip-inner')?.textContent).toBe( - (tooltips as any)[0], - ); + } else if (tooltips[1] === '' && tooltips[0]) { + expect(container.querySelector('.ant-tooltip-inner')?.textContent).toBe(tooltips[0]); } else { - expect(container.querySelector('.ant-tooltip-inner')?.textContent).toBe( - (tooltips as any)[0], - ); + expect(container.querySelector('.ant-tooltip-inner')?.textContent).toBe(tooltips[0]); } // Click to copy diff --git a/components/upload/demo/transform-file.tsx b/components/upload/demo/transform-file.tsx index c2d05684e5..c3e533025a 100644 --- a/components/upload/demo/transform-file.tsx +++ b/components/upload/demo/transform-file.tsx @@ -23,7 +23,7 @@ const props: UploadProps = { ctx.textBaseline = 'middle'; ctx.font = '33px Arial'; ctx.fillText('Ant Design', 20, 20); - canvas.toBlob((result) => resolve(result as any)); + canvas.toBlob((result) => resolve(result as Blob)); }; }; });