From 5fec879148fed2b4676d5c1802b16d0fe3ad3ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 12 Jun 2022 16:30:48 +0200 Subject: [PATCH] Fix mutes test, prefer TypeScript for tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../{preload-test.js => preload.test.ts} | 0 .../{statuses-test.js => statuses.test.ts} | 0 ...est.js => password_reset_confirm.test.tsx} | 0 .../{emoji-test.js => emoji.test.ts} | 0 ...moji_index-test.js => emoji_index.test.ts} | 0 .../{account-test.js => account.test.ts} | 0 ...{attachment-test.js => attachment.test.ts} | 0 .../__tests__/{card-test.js => card.test.ts} | 0 .../{mention-test.js => mention.test.ts} | 0 ...ification-test.js => notification.test.ts} | 0 .../__tests__/{poll-test.js => poll.test.ts} | 0 .../{status-test.js => status.test.ts} | 0 app/soapbox/normalizers/poll.ts | 12 ++++- ..._config-test.js => soapbox_config-test.ts} | 0 .../{accounts-test.js => accounts.test.ts} | 2 +- ...ters-test.js => accounts_counters.test.ts} | 2 +- .../{admin-test.js => admin.test.ts} | 2 +- .../{alerts-test.js => alerts.test.ts} | 0 .../__tests__/{auth-test.js => auth.test.ts} | 0 ...rsations-test.js => conversations.test.ts} | 0 ...m_emojis-test.js => custom_emojis.test.ts} | 0 .../{filters-test.js => filters.test.ts} | 2 +- ...up_editor-test.js => group_editor.test.ts} | 0 ...roup_lists-test.js => group_lists.test.ts} | 0 ...ps-test.js => group_relationships.test.ts} | 0 .../{groups-test.js => groups.test.ts} | 0 .../{index-test.js => index.test.ts} | 0 .../{instance-test.js => instance.test.ts} | 4 +- .../{lists-test.js => lists.test.ts} | 2 +- .../__tests__/{me-test.js => me.test.ts} | 2 +- .../__tests__/{meta-test.js => meta.test.ts} | 0 .../{mutes-test.js => mutes.test.ts} | 50 +++++++++---------- .../{patron-test.js => patron.test.ts} | 2 +- .../{polls-test.js => polls.test.ts} | 2 +- ...ons-test.js => push_notifications.test.ts} | 2 +- .../{reports-test.js => reports.test.ts} | 2 +- .../{settings-test.js => settings.test.ts} | 0 .../{sidebar-test.js => sidebar.test.ts} | 2 +- .../{soapbox-test.js => soapbox.test.ts} | 0 .../{statuses-test.js => statuses.test.ts} | 0 .../{trends-test.js => trends.test.ts} | 0 ...{user_lists-test.js => user_lists.test.ts} | 0 ...ification-test.js => verification.test.ts} | 0 .../{accounts-test.js => accounts.test.ts} | 0 .../{base64-test.js => base64.test.ts} | 0 .../{colors-test.js => colors.test.ts} | 0 .../{features-test.js => features.test.ts} | 0 .../__tests__/{html-test.js => html.test.ts} | 0 .../{phone-test.js => phone.test.ts} | 0 .../{status-test.js => status.test.ts} | 0 .../{tailwind-test.js => tailwind.test.ts} | 0 51 files changed, 49 insertions(+), 39 deletions(-) rename app/soapbox/actions/__tests__/{preload-test.js => preload.test.ts} (100%) rename app/soapbox/actions/__tests__/{statuses-test.js => statuses.test.ts} (100%) rename app/soapbox/features/auth_login/components/__tests__/{password_reset_confirm-test.js => password_reset_confirm.test.tsx} (100%) rename app/soapbox/features/emoji/__tests__/{emoji-test.js => emoji.test.ts} (100%) rename app/soapbox/features/emoji/__tests__/{emoji_index-test.js => emoji_index.test.ts} (100%) rename app/soapbox/normalizers/__tests__/{account-test.js => account.test.ts} (100%) rename app/soapbox/normalizers/__tests__/{attachment-test.js => attachment.test.ts} (100%) rename app/soapbox/normalizers/__tests__/{card-test.js => card.test.ts} (100%) rename app/soapbox/normalizers/__tests__/{mention-test.js => mention.test.ts} (100%) rename app/soapbox/normalizers/__tests__/{notification-test.js => notification.test.ts} (100%) rename app/soapbox/normalizers/__tests__/{poll-test.js => poll.test.ts} (100%) rename app/soapbox/normalizers/__tests__/{status-test.js => status.test.ts} (100%) rename app/soapbox/normalizers/soapbox/__tests__/{soapbox_config-test.js => soapbox_config-test.ts} (100%) rename app/soapbox/reducers/__tests__/{accounts-test.js => accounts.test.ts} (93%) rename app/soapbox/reducers/__tests__/{accounts_counters-test.js => accounts_counters.test.ts} (95%) rename app/soapbox/reducers/__tests__/{admin-test.js => admin.test.ts} (84%) rename app/soapbox/reducers/__tests__/{alerts-test.js => alerts.test.ts} (100%) rename app/soapbox/reducers/__tests__/{auth-test.js => auth.test.ts} (100%) rename app/soapbox/reducers/__tests__/{conversations-test.js => conversations.test.ts} (100%) rename app/soapbox/reducers/__tests__/{custom_emojis-test.js => custom_emojis.test.ts} (100%) rename app/soapbox/reducers/__tests__/{filters-test.js => filters.test.ts} (72%) rename app/soapbox/reducers/__tests__/{group_editor-test.js => group_editor.test.ts} (100%) rename app/soapbox/reducers/__tests__/{group_lists-test.js => group_lists.test.ts} (100%) rename app/soapbox/reducers/__tests__/{group_relationships-test.js => group_relationships.test.ts} (100%) rename app/soapbox/reducers/__tests__/{groups-test.js => groups.test.ts} (100%) rename app/soapbox/reducers/__tests__/{index-test.js => index.test.ts} (100%) rename app/soapbox/reducers/__tests__/{instance-test.js => instance.test.ts} (97%) rename app/soapbox/reducers/__tests__/{lists-test.js => lists.test.ts} (72%) rename app/soapbox/reducers/__tests__/{me-test.js => me.test.ts} (67%) rename app/soapbox/reducers/__tests__/{meta-test.js => meta.test.ts} (100%) rename app/soapbox/reducers/__tests__/{mutes-test.js => mutes.test.ts} (54%) rename app/soapbox/reducers/__tests__/{patron-test.js => patron.test.ts} (94%) rename app/soapbox/reducers/__tests__/{polls-test.js => polls.test.ts} (92%) rename app/soapbox/reducers/__tests__/{push_notifications-test.js => push_notifications.test.ts} (93%) rename app/soapbox/reducers/__tests__/{reports-test.js => reports.test.ts} (84%) rename app/soapbox/reducers/__tests__/{settings-test.js => settings.test.ts} (100%) rename app/soapbox/reducers/__tests__/{sidebar-test.js => sidebar.test.ts} (63%) rename app/soapbox/reducers/__tests__/{soapbox-test.js => soapbox.test.ts} (100%) rename app/soapbox/reducers/__tests__/{statuses-test.js => statuses.test.ts} (100%) rename app/soapbox/reducers/__tests__/{trends-test.js => trends.test.ts} (100%) rename app/soapbox/reducers/__tests__/{user_lists-test.js => user_lists.test.ts} (100%) rename app/soapbox/reducers/__tests__/{verification-test.js => verification.test.ts} (100%) rename app/soapbox/utils/__tests__/{accounts-test.js => accounts.test.ts} (100%) rename app/soapbox/utils/__tests__/{base64-test.js => base64.test.ts} (100%) rename app/soapbox/utils/__tests__/{colors-test.js => colors.test.ts} (100%) rename app/soapbox/utils/__tests__/{features-test.js => features.test.ts} (100%) rename app/soapbox/utils/__tests__/{html-test.js => html.test.ts} (100%) rename app/soapbox/utils/__tests__/{phone-test.js => phone.test.ts} (100%) rename app/soapbox/utils/__tests__/{status-test.js => status.test.ts} (100%) rename app/soapbox/utils/__tests__/{tailwind-test.js => tailwind.test.ts} (100%) diff --git a/app/soapbox/actions/__tests__/preload-test.js b/app/soapbox/actions/__tests__/preload.test.ts similarity index 100% rename from app/soapbox/actions/__tests__/preload-test.js rename to app/soapbox/actions/__tests__/preload.test.ts diff --git a/app/soapbox/actions/__tests__/statuses-test.js b/app/soapbox/actions/__tests__/statuses.test.ts similarity index 100% rename from app/soapbox/actions/__tests__/statuses-test.js rename to app/soapbox/actions/__tests__/statuses.test.ts diff --git a/app/soapbox/features/auth_login/components/__tests__/password_reset_confirm-test.js b/app/soapbox/features/auth_login/components/__tests__/password_reset_confirm.test.tsx similarity index 100% rename from app/soapbox/features/auth_login/components/__tests__/password_reset_confirm-test.js rename to app/soapbox/features/auth_login/components/__tests__/password_reset_confirm.test.tsx diff --git a/app/soapbox/features/emoji/__tests__/emoji-test.js b/app/soapbox/features/emoji/__tests__/emoji.test.ts similarity index 100% rename from app/soapbox/features/emoji/__tests__/emoji-test.js rename to app/soapbox/features/emoji/__tests__/emoji.test.ts diff --git a/app/soapbox/features/emoji/__tests__/emoji_index-test.js b/app/soapbox/features/emoji/__tests__/emoji_index.test.ts similarity index 100% rename from app/soapbox/features/emoji/__tests__/emoji_index-test.js rename to app/soapbox/features/emoji/__tests__/emoji_index.test.ts diff --git a/app/soapbox/normalizers/__tests__/account-test.js b/app/soapbox/normalizers/__tests__/account.test.ts similarity index 100% rename from app/soapbox/normalizers/__tests__/account-test.js rename to app/soapbox/normalizers/__tests__/account.test.ts diff --git a/app/soapbox/normalizers/__tests__/attachment-test.js b/app/soapbox/normalizers/__tests__/attachment.test.ts similarity index 100% rename from app/soapbox/normalizers/__tests__/attachment-test.js rename to app/soapbox/normalizers/__tests__/attachment.test.ts diff --git a/app/soapbox/normalizers/__tests__/card-test.js b/app/soapbox/normalizers/__tests__/card.test.ts similarity index 100% rename from app/soapbox/normalizers/__tests__/card-test.js rename to app/soapbox/normalizers/__tests__/card.test.ts diff --git a/app/soapbox/normalizers/__tests__/mention-test.js b/app/soapbox/normalizers/__tests__/mention.test.ts similarity index 100% rename from app/soapbox/normalizers/__tests__/mention-test.js rename to app/soapbox/normalizers/__tests__/mention.test.ts diff --git a/app/soapbox/normalizers/__tests__/notification-test.js b/app/soapbox/normalizers/__tests__/notification.test.ts similarity index 100% rename from app/soapbox/normalizers/__tests__/notification-test.js rename to app/soapbox/normalizers/__tests__/notification.test.ts diff --git a/app/soapbox/normalizers/__tests__/poll-test.js b/app/soapbox/normalizers/__tests__/poll.test.ts similarity index 100% rename from app/soapbox/normalizers/__tests__/poll-test.js rename to app/soapbox/normalizers/__tests__/poll.test.ts diff --git a/app/soapbox/normalizers/__tests__/status-test.js b/app/soapbox/normalizers/__tests__/status.test.ts similarity index 100% rename from app/soapbox/normalizers/__tests__/status-test.js rename to app/soapbox/normalizers/__tests__/status.test.ts diff --git a/app/soapbox/normalizers/poll.ts b/app/soapbox/normalizers/poll.ts index d2b1bf492..7b98d1354 100644 --- a/app/soapbox/normalizers/poll.ts +++ b/app/soapbox/normalizers/poll.ts @@ -47,8 +47,18 @@ const normalizeEmojis = (entity: ImmutableMap) => { }); }; -const normalizePollOption = (option: ImmutableMap, emojis: ImmutableList> = ImmutableList()) => { +const normalizePollOption = (option: ImmutableMap | string, emojis: ImmutableList> = ImmutableList()) => { const emojiMap = makeEmojiMap(emojis); + + if (typeof option === 'string') { + const titleEmojified = emojify(escapeTextContentForBrowser(option), emojiMap); + + return PollOptionRecord({ + title: option, + title_emojified: titleEmojified, + }); + } + const titleEmojified = emojify(escapeTextContentForBrowser(option.get('title')), emojiMap); return PollOptionRecord( diff --git a/app/soapbox/normalizers/soapbox/__tests__/soapbox_config-test.js b/app/soapbox/normalizers/soapbox/__tests__/soapbox_config-test.ts similarity index 100% rename from app/soapbox/normalizers/soapbox/__tests__/soapbox_config-test.js rename to app/soapbox/normalizers/soapbox/__tests__/soapbox_config-test.ts diff --git a/app/soapbox/reducers/__tests__/accounts-test.js b/app/soapbox/reducers/__tests__/accounts.test.ts similarity index 93% rename from app/soapbox/reducers/__tests__/accounts-test.js rename to app/soapbox/reducers/__tests__/accounts.test.ts index 4b7915d32..647bb676a 100644 --- a/app/soapbox/reducers/__tests__/accounts-test.js +++ b/app/soapbox/reducers/__tests__/accounts.test.ts @@ -6,7 +6,7 @@ import reducer from '../accounts'; describe('accounts reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {})).toEqual(ImmutableMap()); + expect(reducer(undefined, {} as any)).toEqual(ImmutableMap()); }); describe('ACCOUNT_IMPORT', () => { diff --git a/app/soapbox/reducers/__tests__/accounts_counters-test.js b/app/soapbox/reducers/__tests__/accounts_counters.test.ts similarity index 95% rename from app/soapbox/reducers/__tests__/accounts_counters-test.js rename to app/soapbox/reducers/__tests__/accounts_counters.test.ts index ca1a279e0..114f28b54 100644 --- a/app/soapbox/reducers/__tests__/accounts_counters-test.js +++ b/app/soapbox/reducers/__tests__/accounts_counters.test.ts @@ -9,7 +9,7 @@ import reducer from '../accounts_counters'; describe('accounts_counters reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {})).toEqual(ImmutableMap()); + expect(reducer(undefined, {} as any)).toEqual(ImmutableMap()); }); // it('should handle ACCOUNT_FOLLOW_SUCCESS', () => { diff --git a/app/soapbox/reducers/__tests__/admin-test.js b/app/soapbox/reducers/__tests__/admin.test.ts similarity index 84% rename from app/soapbox/reducers/__tests__/admin-test.js rename to app/soapbox/reducers/__tests__/admin.test.ts index 43018c880..a83e11022 100644 --- a/app/soapbox/reducers/__tests__/admin-test.js +++ b/app/soapbox/reducers/__tests__/admin.test.ts @@ -4,7 +4,7 @@ import reducer from '../admin'; describe('admin reducer', () => { it('should return the initial state', () => { - const result = reducer(undefined, {}); + const result = reducer(undefined, {} as any); expect(ImmutableRecord.isRecord(result)).toBe(true); expect(result.needsReboot).toBe(false); }); diff --git a/app/soapbox/reducers/__tests__/alerts-test.js b/app/soapbox/reducers/__tests__/alerts.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/alerts-test.js rename to app/soapbox/reducers/__tests__/alerts.test.ts diff --git a/app/soapbox/reducers/__tests__/auth-test.js b/app/soapbox/reducers/__tests__/auth.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/auth-test.js rename to app/soapbox/reducers/__tests__/auth.test.ts diff --git a/app/soapbox/reducers/__tests__/conversations-test.js b/app/soapbox/reducers/__tests__/conversations.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/conversations-test.js rename to app/soapbox/reducers/__tests__/conversations.test.ts diff --git a/app/soapbox/reducers/__tests__/custom_emojis-test.js b/app/soapbox/reducers/__tests__/custom_emojis.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/custom_emojis-test.js rename to app/soapbox/reducers/__tests__/custom_emojis.test.ts diff --git a/app/soapbox/reducers/__tests__/filters-test.js b/app/soapbox/reducers/__tests__/filters.test.ts similarity index 72% rename from app/soapbox/reducers/__tests__/filters-test.js rename to app/soapbox/reducers/__tests__/filters.test.ts index 90bfc1323..5faa0f948 100644 --- a/app/soapbox/reducers/__tests__/filters-test.js +++ b/app/soapbox/reducers/__tests__/filters.test.ts @@ -4,6 +4,6 @@ import reducer from '../filters'; describe('filters reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {})).toEqual(ImmutableList()); + expect(reducer(undefined, {} as any)).toEqual(ImmutableList()); }); }); diff --git a/app/soapbox/reducers/__tests__/group_editor-test.js b/app/soapbox/reducers/__tests__/group_editor.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/group_editor-test.js rename to app/soapbox/reducers/__tests__/group_editor.test.ts diff --git a/app/soapbox/reducers/__tests__/group_lists-test.js b/app/soapbox/reducers/__tests__/group_lists.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/group_lists-test.js rename to app/soapbox/reducers/__tests__/group_lists.test.ts diff --git a/app/soapbox/reducers/__tests__/group_relationships-test.js b/app/soapbox/reducers/__tests__/group_relationships.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/group_relationships-test.js rename to app/soapbox/reducers/__tests__/group_relationships.test.ts diff --git a/app/soapbox/reducers/__tests__/groups-test.js b/app/soapbox/reducers/__tests__/groups.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/groups-test.js rename to app/soapbox/reducers/__tests__/groups.test.ts diff --git a/app/soapbox/reducers/__tests__/index-test.js b/app/soapbox/reducers/__tests__/index.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/index-test.js rename to app/soapbox/reducers/__tests__/index.test.ts diff --git a/app/soapbox/reducers/__tests__/instance-test.js b/app/soapbox/reducers/__tests__/instance.test.ts similarity index 97% rename from app/soapbox/reducers/__tests__/instance-test.js rename to app/soapbox/reducers/__tests__/instance.test.ts index 33a5fab55..8357d6851 100644 --- a/app/soapbox/reducers/__tests__/instance-test.js +++ b/app/soapbox/reducers/__tests__/instance.test.ts @@ -7,7 +7,7 @@ import reducer from '../instance'; describe('instance reducer', () => { it('should return the initial state', () => { - const result = reducer(undefined, {}); + const result = reducer(undefined, {} as any); const expected = { description_limit: 1500, @@ -128,7 +128,7 @@ describe('instance reducer', () => { }; // The normalizer has `registrations: closed` by default - const state = reducer(undefined, {}); + const state = reducer(undefined, {} as any); expect(state.registrations).toBe(false); // After importing the configs, registration will be open diff --git a/app/soapbox/reducers/__tests__/lists-test.js b/app/soapbox/reducers/__tests__/lists.test.ts similarity index 72% rename from app/soapbox/reducers/__tests__/lists-test.js rename to app/soapbox/reducers/__tests__/lists.test.ts index 56afd7a5c..43881a218 100644 --- a/app/soapbox/reducers/__tests__/lists-test.js +++ b/app/soapbox/reducers/__tests__/lists.test.ts @@ -4,6 +4,6 @@ import reducer from '../lists'; describe('lists reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {})).toEqual(ImmutableMap()); + expect(reducer(undefined, {} as any)).toEqual(ImmutableMap()); }); }); diff --git a/app/soapbox/reducers/__tests__/me-test.js b/app/soapbox/reducers/__tests__/me.test.ts similarity index 67% rename from app/soapbox/reducers/__tests__/me-test.js rename to app/soapbox/reducers/__tests__/me.test.ts index 2c434dca4..28504ba54 100644 --- a/app/soapbox/reducers/__tests__/me-test.js +++ b/app/soapbox/reducers/__tests__/me.test.ts @@ -2,6 +2,6 @@ import reducer from '../me'; describe('me reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {})).toEqual(null); + expect(reducer(undefined, {} as any)).toEqual(null); }); }); diff --git a/app/soapbox/reducers/__tests__/meta-test.js b/app/soapbox/reducers/__tests__/meta.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/meta-test.js rename to app/soapbox/reducers/__tests__/meta.test.ts diff --git a/app/soapbox/reducers/__tests__/mutes-test.js b/app/soapbox/reducers/__tests__/mutes.test.ts similarity index 54% rename from app/soapbox/reducers/__tests__/mutes-test.js rename to app/soapbox/reducers/__tests__/mutes.test.ts index 175f2ff38..512a5260f 100644 --- a/app/soapbox/reducers/__tests__/mutes-test.js +++ b/app/soapbox/reducers/__tests__/mutes.test.ts @@ -1,4 +1,4 @@ -import { Map as ImmutableMap } from 'immutable'; +import { Record as ImmutableRecord } from 'immutable'; import { MUTES_INIT_MODAL, @@ -9,50 +9,50 @@ import reducer from '../mutes'; describe('mutes reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {})).toEqual(ImmutableMap({ - new: ImmutableMap({ + expect(reducer(undefined, {}).toJS()).toEqual({ + new: { isSubmitting: false, - account: null, + accountId: null, notifications: true, - }), - })); + }, + }); }); it('should handle MUTES_INIT_MODAL', () => { - const state = ImmutableMap({ - new: ImmutableMap({ + const state = ImmutableRecord({ + new: ImmutableRecord({ isSubmitting: false, - account: null, + accountId: null, notifications: true, - }), - }); + })(), + })(); const action = { type: MUTES_INIT_MODAL, - account: 'account1', + account: { id: 'account1' }, }; - expect(reducer(state, action)).toEqual(ImmutableMap({ - new: ImmutableMap({ + expect(reducer(state, action).toJS()).toEqual({ + new: { isSubmitting: false, - account: 'account1', + accountId: 'account1', notifications: true, - }), - })); + }, + }); }); it('should handle MUTES_TOGGLE_HIDE_NOTIFICATIONS', () => { - const state = ImmutableMap({ - new: ImmutableMap({ + const state = ImmutableRecord({ + new: ImmutableRecord({ notifications: true, - }), - }); + })(), + })(); const action = { type: MUTES_TOGGLE_HIDE_NOTIFICATIONS, }; - expect(reducer(state, action)).toEqual(ImmutableMap({ - new: ImmutableMap({ + expect(reducer(state, action).toJS()).toEqual({ + new: { notifications: false, - }), - })); + }, + }); }); }); diff --git a/app/soapbox/reducers/__tests__/patron-test.js b/app/soapbox/reducers/__tests__/patron.test.ts similarity index 94% rename from app/soapbox/reducers/__tests__/patron-test.js rename to app/soapbox/reducers/__tests__/patron.test.ts index 01736704b..4424285cd 100644 --- a/app/soapbox/reducers/__tests__/patron-test.js +++ b/app/soapbox/reducers/__tests__/patron.test.ts @@ -5,7 +5,7 @@ import reducer from '../patron'; describe('patron reducer', () => { it('should return the initial state', () => { - const result = reducer(undefined, {}); + const result = reducer(undefined, {} as any); expect(ImmutableRecord.isRecord(result)).toBe(true); expect(result.instance.url).toBe(''); }); diff --git a/app/soapbox/reducers/__tests__/polls-test.js b/app/soapbox/reducers/__tests__/polls.test.ts similarity index 92% rename from app/soapbox/reducers/__tests__/polls-test.js rename to app/soapbox/reducers/__tests__/polls.test.ts index b19ad858c..b9ceb07f7 100644 --- a/app/soapbox/reducers/__tests__/polls-test.js +++ b/app/soapbox/reducers/__tests__/polls.test.ts @@ -6,7 +6,7 @@ import reducer from '../polls'; describe('polls reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {})).toEqual(ImmutableMap()); + expect(reducer(undefined, {} as any)).toEqual(ImmutableMap()); }); describe('POLLS_IMPORT', () => { diff --git a/app/soapbox/reducers/__tests__/push_notifications-test.js b/app/soapbox/reducers/__tests__/push_notifications.test.ts similarity index 93% rename from app/soapbox/reducers/__tests__/push_notifications-test.js rename to app/soapbox/reducers/__tests__/push_notifications.test.ts index a5db7131d..e7080d42a 100644 --- a/app/soapbox/reducers/__tests__/push_notifications-test.js +++ b/app/soapbox/reducers/__tests__/push_notifications.test.ts @@ -6,7 +6,7 @@ describe('push_notifications reducer', () => { it('should return the initial state', () => { expect(reducer(undefined, {})).toEqual(ImmutableMap({ subscription: null, - alerts: new ImmutableMap({ + alerts: ImmutableMap({ follow: true, follow_request: true, favourite: true, diff --git a/app/soapbox/reducers/__tests__/reports-test.js b/app/soapbox/reducers/__tests__/reports.test.ts similarity index 84% rename from app/soapbox/reducers/__tests__/reports-test.js rename to app/soapbox/reducers/__tests__/reports.test.ts index 975a7ec49..77148e572 100644 --- a/app/soapbox/reducers/__tests__/reports-test.js +++ b/app/soapbox/reducers/__tests__/reports.test.ts @@ -2,7 +2,7 @@ import reducer from '../reports'; describe('reports reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {}).toJS()).toEqual({ + expect(reducer(undefined, {} as any).toJS()).toEqual({ new: { isSubmitting: false, account_id: null, diff --git a/app/soapbox/reducers/__tests__/settings-test.js b/app/soapbox/reducers/__tests__/settings.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/settings-test.js rename to app/soapbox/reducers/__tests__/settings.test.ts diff --git a/app/soapbox/reducers/__tests__/sidebar-test.js b/app/soapbox/reducers/__tests__/sidebar.test.ts similarity index 63% rename from app/soapbox/reducers/__tests__/sidebar-test.js rename to app/soapbox/reducers/__tests__/sidebar.test.ts index 511325488..83212335f 100644 --- a/app/soapbox/reducers/__tests__/sidebar-test.js +++ b/app/soapbox/reducers/__tests__/sidebar.test.ts @@ -2,6 +2,6 @@ import reducer from '../sidebar'; describe('sidebar reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {})).toEqual({ sidebarOpen: false }); + expect(reducer(undefined, {} as any)).toEqual({ sidebarOpen: false }); }); }); diff --git a/app/soapbox/reducers/__tests__/soapbox-test.js b/app/soapbox/reducers/__tests__/soapbox.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/soapbox-test.js rename to app/soapbox/reducers/__tests__/soapbox.test.ts diff --git a/app/soapbox/reducers/__tests__/statuses-test.js b/app/soapbox/reducers/__tests__/statuses.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/statuses-test.js rename to app/soapbox/reducers/__tests__/statuses.test.ts diff --git a/app/soapbox/reducers/__tests__/trends-test.js b/app/soapbox/reducers/__tests__/trends.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/trends-test.js rename to app/soapbox/reducers/__tests__/trends.test.ts diff --git a/app/soapbox/reducers/__tests__/user_lists-test.js b/app/soapbox/reducers/__tests__/user_lists.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/user_lists-test.js rename to app/soapbox/reducers/__tests__/user_lists.test.ts diff --git a/app/soapbox/reducers/__tests__/verification-test.js b/app/soapbox/reducers/__tests__/verification.test.ts similarity index 100% rename from app/soapbox/reducers/__tests__/verification-test.js rename to app/soapbox/reducers/__tests__/verification.test.ts diff --git a/app/soapbox/utils/__tests__/accounts-test.js b/app/soapbox/utils/__tests__/accounts.test.ts similarity index 100% rename from app/soapbox/utils/__tests__/accounts-test.js rename to app/soapbox/utils/__tests__/accounts.test.ts diff --git a/app/soapbox/utils/__tests__/base64-test.js b/app/soapbox/utils/__tests__/base64.test.ts similarity index 100% rename from app/soapbox/utils/__tests__/base64-test.js rename to app/soapbox/utils/__tests__/base64.test.ts diff --git a/app/soapbox/utils/__tests__/colors-test.js b/app/soapbox/utils/__tests__/colors.test.ts similarity index 100% rename from app/soapbox/utils/__tests__/colors-test.js rename to app/soapbox/utils/__tests__/colors.test.ts diff --git a/app/soapbox/utils/__tests__/features-test.js b/app/soapbox/utils/__tests__/features.test.ts similarity index 100% rename from app/soapbox/utils/__tests__/features-test.js rename to app/soapbox/utils/__tests__/features.test.ts diff --git a/app/soapbox/utils/__tests__/html-test.js b/app/soapbox/utils/__tests__/html.test.ts similarity index 100% rename from app/soapbox/utils/__tests__/html-test.js rename to app/soapbox/utils/__tests__/html.test.ts diff --git a/app/soapbox/utils/__tests__/phone-test.js b/app/soapbox/utils/__tests__/phone.test.ts similarity index 100% rename from app/soapbox/utils/__tests__/phone-test.js rename to app/soapbox/utils/__tests__/phone.test.ts diff --git a/app/soapbox/utils/__tests__/status-test.js b/app/soapbox/utils/__tests__/status.test.ts similarity index 100% rename from app/soapbox/utils/__tests__/status-test.js rename to app/soapbox/utils/__tests__/status.test.ts diff --git a/app/soapbox/utils/__tests__/tailwind-test.js b/app/soapbox/utils/__tests__/tailwind.test.ts similarity index 100% rename from app/soapbox/utils/__tests__/tailwind-test.js rename to app/soapbox/utils/__tests__/tailwind.test.ts