diff --git a/app/soapbox/features/auth_login/components/__tests__/captcha.test.tsx b/app/soapbox/features/auth_login/components/__tests__/captcha.test.tsx index d48071b0c..bb09d1dba 100644 --- a/app/soapbox/features/auth_login/components/__tests__/captcha.test.tsx +++ b/app/soapbox/features/auth_login/components/__tests__/captcha.test.tsx @@ -6,7 +6,7 @@ import CaptchaField, { NativeCaptchaField } from '../captcha'; describe('', () => { it('renders null by default', () => { - render(); + render(); expect(screen.queryAllByRole('textbox')).toHaveLength(0); }); @@ -24,7 +24,9 @@ describe('', () => { render( {}} // eslint-disable-line react/jsx-no-bind + onChange={() => {}} + onClick={() => {}} + value='' />, ); diff --git a/app/soapbox/features/auth_login/components/__tests__/login_form.test.tsx b/app/soapbox/features/auth_login/components/__tests__/login_form.test.tsx index ac1c52930..b46acf31a 100644 --- a/app/soapbox/features/auth_login/components/__tests__/login_form.test.tsx +++ b/app/soapbox/features/auth_login/components/__tests__/login_form.test.tsx @@ -13,7 +13,7 @@ describe('', () => { }), }; - render(, null, store); + render(, undefined, store); expect(screen.getByRole('heading')).toHaveTextContent(/sign in/i); }); @@ -26,7 +26,7 @@ describe('', () => { }), }; - render(, null, store); + render(, undefined, store); expect(screen.getByRole('heading')).toHaveTextContent(/sign in/i); }); diff --git a/app/soapbox/features/auth_login/components/__tests__/login_page.test.tsx b/app/soapbox/features/auth_login/components/__tests__/login_page.test.tsx index 85daf3e4e..50f94b285 100644 --- a/app/soapbox/features/auth_login/components/__tests__/login_page.test.tsx +++ b/app/soapbox/features/auth_login/components/__tests__/login_page.test.tsx @@ -12,7 +12,7 @@ describe('', () => { }), }; - render(, null, store); + render(, undefined, store); expect(screen.getByRole('heading')).toHaveTextContent('Sign In'); }); diff --git a/app/soapbox/features/emoji/__tests__/emoji_index.test.ts b/app/soapbox/features/emoji/__tests__/emoji_index.test.ts index 99f46e3b3..78698981a 100644 --- a/app/soapbox/features/emoji/__tests__/emoji_index.test.ts +++ b/app/soapbox/features/emoji/__tests__/emoji_index.test.ts @@ -1,9 +1,10 @@ +// @ts-ignore import { emojiIndex } from 'emoji-mart'; import pick from 'lodash/pick'; import { search } from '../emoji_mart_search_light'; -const trimEmojis = emoji => pick(emoji, ['id', 'unified', 'native', 'custom']); +const trimEmojis = (emoji: any) => pick(emoji, ['id', 'unified', 'native', 'custom']); describe('emoji_index', () => { it('should give same result for emoji_index_light and emoji-mart', () => { @@ -46,7 +47,7 @@ describe('emoji_index', () => { }); it('can include/exclude categories', () => { - expect(search('flag', { include: ['people'] })).toEqual([]); + expect(search('flag', { include: ['people'] } as any)).toEqual([]); expect(emojiIndex.search('flag', { include: ['people'] })).toEqual([]); }); @@ -63,9 +64,8 @@ describe('emoji_index', () => { custom: true, }, ]; - search('', { custom }); + search('', { custom } as any); emojiIndex.search('', { custom }); - const expected = []; const lightExpected = [ { id: 'mastodon', @@ -73,7 +73,7 @@ describe('emoji_index', () => { }, ]; expect(search('masto').map(trimEmojis)).toEqual(lightExpected); - expect(emojiIndex.search('masto').map(trimEmojis)).toEqual(expected); + expect(emojiIndex.search('masto').map(trimEmojis)).toEqual([]); }); it('(different behavior from emoji-mart) erases custom emoji if another is passed', () => { @@ -89,11 +89,10 @@ describe('emoji_index', () => { custom: true, }, ]; - search('', { custom }); + search('', { custom } as any); emojiIndex.search('', { custom }); - const expected = []; - expect(search('masto', { custom: [] }).map(trimEmojis)).toEqual(expected); - expect(emojiIndex.search('masto').map(trimEmojis)).toEqual(expected); + expect(search('masto', { custom: [] } as any).map(trimEmojis)).toEqual([]); + expect(emojiIndex.search('masto').map(trimEmojis)).toEqual([]); }); it('handles custom emoji', () => { @@ -109,7 +108,7 @@ describe('emoji_index', () => { custom: true, }, ]; - search('', { custom }); + search('', { custom } as any); emojiIndex.search('', { custom }); const expected = [ { @@ -117,15 +116,15 @@ describe('emoji_index', () => { custom: true, }, ]; - expect(search('masto', { custom }).map(trimEmojis)).toEqual(expected); + expect(search('masto', { custom } as any).map(trimEmojis)).toEqual(expected); expect(emojiIndex.search('masto', { custom }).map(trimEmojis)).toEqual(expected); }); it('should filter only emojis we care about, exclude pineapple', () => { - const emojisToShowFilter = emoji => emoji.unified !== '1F34D'; - expect(search('apple', { emojisToShowFilter }).map((obj) => obj.id)) + const emojisToShowFilter = (emoji: any) => emoji.unified !== '1F34D'; + expect(search('apple', { emojisToShowFilter } as any).map((obj: any) => obj.id)) .not.toContain('pineapple'); - expect(emojiIndex.search('apple', { emojisToShowFilter }).map((obj) => obj.id)) + expect(emojiIndex.search('apple', { emojisToShowFilter }).map((obj: any) => obj.id)) .not.toContain('pineapple'); }); diff --git a/app/soapbox/features/feed-filtering/__tests__/feed-carousel.test.tsx b/app/soapbox/features/feed-filtering/__tests__/feed-carousel.test.tsx index 096682fa0..eb84e7ad0 100644 --- a/app/soapbox/features/feed-filtering/__tests__/feed-carousel.test.tsx +++ b/app/soapbox/features/feed-filtering/__tests__/feed-carousel.test.tsx @@ -18,7 +18,7 @@ jest.mock('../../../hooks/useDimensions', () => ({ }; describe('', () => { - let store; + let store: any; describe('with "feedUserFiltering" disabled', () => { beforeEach(() => { @@ -35,7 +35,7 @@ describe('', () => { }); it('should render nothing', () => { - render(, null, store); + render(, undefined, store); expect(screen.queryAllByTestId('feed-carousel')).toHaveLength(0); }); @@ -56,7 +56,7 @@ describe('', () => { }); it('should render the Carousel', () => { - render(, null, store); + render(, undefined, store); expect(screen.queryAllByTestId('feed-carousel')).toHaveLength(1); }); @@ -70,7 +70,7 @@ describe('', () => { }); it('renders the error message', () => { - render(, null, store); + render(, undefined, store); expect(screen.getByTestId('feed-carousel-error')).toBeInTheDocument(); }); @@ -110,7 +110,7 @@ describe('', () => { it('should render the correct prev/next buttons', async() => { const user = userEvent.setup(); - render(, null, store); + render(, undefined, store); await waitFor(() => { expect(screen.getByTestId('next-page')).toBeInTheDocument(); diff --git a/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx b/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx index 02b9a4fe0..a52dbd975 100644 --- a/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx +++ b/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx @@ -17,7 +17,7 @@ describe('', () => { }, }); - render(, null, state); + render(, undefined, state); expect(screen.queryByTestId('registrations-open')).toBeInTheDocument(); expect(screen.queryByTestId('registrations-closed')).not.toBeInTheDocument(); @@ -34,7 +34,7 @@ describe('', () => { }, }); - render(, null, state); + render(, undefined, state); expect(screen.queryByTestId('registrations-closed')).toBeInTheDocument(); expect(screen.queryByTestId('registrations-open')).not.toBeInTheDocument(); @@ -59,7 +59,7 @@ describe('', () => { }, }], rootReducer); - render(, null, state); + render(, undefined, state); expect(screen.queryByTestId('registrations-pepe')).toBeInTheDocument(); expect(screen.queryByTestId('registrations-open')).not.toBeInTheDocument(); @@ -81,7 +81,7 @@ describe('', () => { }, }], rootReducer); - render(, null, state); + render(, undefined, state); expect(screen.queryByTestId('registrations-closed')).toBeInTheDocument(); expect(screen.queryByTestId('registrations-pepe')).not.toBeInTheDocument();