diff --git a/apps/web/__tests__/middleware.test.ts b/apps/web/__tests__/middleware.test.ts index 2aefadcfefbf6e8823dd5f41095b48570c8aa011..e5967aff8416ca4810845bcaeb41a2d25386a3f8 100644 --- a/apps/web/__tests__/middleware.test.ts +++ b/apps/web/__tests__/middleware.test.ts @@ -38,7 +38,7 @@ const createRequest = ({ get: () => acceptLanguage, }, url, - } as NextRequest + } as unknown as NextRequest } describe('middleware', () => { diff --git a/apps/web/helpers/__tests__/detectLocaleFromHeader.test.ts b/apps/web/helpers/__tests__/detectLocaleFromHeader.test.ts index d3c3af00d03f726d3bb887b016525e09ba0d899b..facc66410e51b0d181f357822e0f9c3d02a5382c 100644 --- a/apps/web/helpers/__tests__/detectLocaleFromHeader.test.ts +++ b/apps/web/helpers/__tests__/detectLocaleFromHeader.test.ts @@ -9,7 +9,7 @@ const createApiHeaders = (acceptLanguage = '') => ({ const createHeaders = (acceptLanguage = '') => ({ get: () => acceptLanguage, - } as NextRequest['headers']) + } as unknown as NextRequest['headers']) describe('detectLocaleFromHeader', () => { describe('api request', () => { diff --git a/apps/web/helpers/__tests__/detectLocaleFromRequest.test.ts b/apps/web/helpers/__tests__/detectLocaleFromRequest.test.ts index c816237b42e0860c48b8bd9d24a36576bd958703..4300d534af5edff0bd3a4f60dccdcc767fd807d9 100644 --- a/apps/web/helpers/__tests__/detectLocaleFromRequest.test.ts +++ b/apps/web/helpers/__tests__/detectLocaleFromRequest.test.ts @@ -10,7 +10,7 @@ const createRequest = (acceptLanguage = '', locale?: string) => query: { locale, }, - } as NextApiRequest) + } as unknown as NextApiRequest) describe('detectLocaleFromRequest', () => { it('should use locale from query parameter', () => { diff --git a/core/errors/hooks/__tests__/useFieldErrors.test.ts b/core/errors/hooks/__tests__/useFieldErrors.test.ts index 6aa94844b0239a2159940cccb5bc80e3d3d959a7..072ce690687e39c923903fb55df721e8a7566b29 100644 --- a/core/errors/hooks/__tests__/useFieldErrors.test.ts +++ b/core/errors/hooks/__tests__/useFieldErrors.test.ts @@ -32,6 +32,8 @@ const graphQlError: GraphQLError = { originalError: undefined, name: '', message: '', + toJSON: jest.fn(), + [Symbol.toStringTag]: '', } describe('useFieldErrors', () => { diff --git a/core/pagination/__tests__/testData.ts b/core/pagination/__tests__/testData.ts index 1d3e339ac48f7f05f51f2cbc16acaf8e9b69146b..2e11449462059d840694ddd31e977dbd937249b5 100644 --- a/core/pagination/__tests__/testData.ts +++ b/core/pagination/__tests__/testData.ts @@ -23,6 +23,7 @@ const insight: Insight = { data: [], }, isFavorite: false, + polls: [], } export const createInsightList = (length = 3) => diff --git a/core/screens/spaces/helpers/__tests__/defaultFilters.test.ts b/core/screens/spaces/helpers/__tests__/defaultFilters.test.ts index 28973cad02722d1175b8cd782843690db9d9cf2e..b780a4bf6d027868677fcb690c650bbf816f6cb6 100644 --- a/core/screens/spaces/helpers/__tests__/defaultFilters.test.ts +++ b/core/screens/spaces/helpers/__tests__/defaultFilters.test.ts @@ -1,12 +1,13 @@ +import { Topic } from '@holi/core/domain/shared/types' import { getDefaultTopicIds } from '@holi/core/screens/spaces/helpers/defaultFilters' -const topics = [ - { id: 'a', title: 'a', isDiscoverSpacesDefault: true }, - { id: 'b', title: 'b', isDiscoverSpacesDefault: true }, - { id: 'c', title: 'c', isDiscoverSpacesDefault: true }, - { id: 'd', title: 'd', isDiscoverSpacesDefault: false }, - { id: 'e', title: 'e', isDiscoverSpacesDefault: false }, - { id: 'f', title: 'f', isDiscoverSpacesDefault: false }, +const topics: Topic[] = [ + { id: 'a', title: 'a', isDiscoverSpacesDefault: true, slug: 'a' }, + { id: 'b', title: 'b', isDiscoverSpacesDefault: true, slug: 'b' }, + { id: 'c', title: 'c', isDiscoverSpacesDefault: true, slug: 'c' }, + { id: 'd', title: 'd', isDiscoverSpacesDefault: false, slug: 'd' }, + { id: 'e', title: 'e', isDiscoverSpacesDefault: false, slug: 'e' }, + { id: 'f', title: 'f', isDiscoverSpacesDefault: false, slug: 'f' }, ] describe('SpacesGrid', () => { it('returns empty when default topic ids are the same as user topic ids', () => { diff --git a/core/tracking/__tests__/useTracking.test.ts b/core/tracking/__tests__/useTracking.test.ts index 1abff1aab713602f5a62d8c58d3744b101af9798..f8d18b8273d1c86d492fa463304b66fae8c5068d 100644 --- a/core/tracking/__tests__/useTracking.test.ts +++ b/core/tracking/__tests__/useTracking.test.ts @@ -21,6 +21,7 @@ const posthogCrossPlatformMock = { reset: jest.fn(), capture: jest.fn(), identify: jest.fn(), + distinctId: jest.fn(), } as PosthogCrossPlatform const usePosthogCrossPlatformMock = usePosthogCrossPlatform as jest.Mock diff --git a/e2e/web/broken/spaces.spec.ts b/e2e/web/broken/spaces.spec.ts index d1e43b4389f4d05a88a2bbf856100583d9c27c99..86108e25e230e3f49295efe157d466965477d880 100644 --- a/e2e/web/broken/spaces.spec.ts +++ b/e2e/web/broken/spaces.spec.ts @@ -9,14 +9,14 @@ import { proceedAsGuest, waitForAnimationEnd, withSSR, -} from '../tests/helpers' -import { inputSpaceNameAndGoal } from '../tests/helpers/spaces' -import { SessionHandler, test } from '../tests/testmaster' +} from '@holi/e2e-web/tests/helpers' +import { inputSpaceNameAndGoal } from '@holi/e2e-web/tests/helpers/spaces' +import { SessionHandler, test } from '@holi/e2e-web/tests/testmaster' test.setTimeout(240000) test.describe('@Spaces', () => { - test('user journey', async ({ browser, browserName, context, page, sessions }) => { + test('user journey', async ({ browser, browserName, page, sessions }) => { test.skip( browserName === 'webkit', 'webkit fails regularly due to timing, race conditions, in a flaky way. Due to time constraints, we disabled the suite.' @@ -39,7 +39,7 @@ test.describe('@Spaces', () => { await withSSR(browser, page.url(), testDisplaysSpaceDetailsCommon) await testShareSpace(browserName, page) - await testCreatingEditingDeletingASpace(browser, context, page, sessions) + await testCreatingEditingDeletingASpace(browser, sessions) }) }) diff --git a/global.d.ts b/global.d.ts index 651a6dcd3576c1dada0bc86b4faba625362e042c..b9954d379ba733e80d9609ddc010fd83bd81e32d 100644 --- a/global.d.ts +++ b/global.d.ts @@ -6,7 +6,7 @@ import { HoliToastType } from '@holi/ui/components/molecules/HoliToastProvider' declare global { var mockNavigate: (routeName: string) => void - var captureSentryException: (error: Error) => void + var captureSentryException: Mock<(error: Error) => void> var mockSetOptions: (options: Partial<ScreenOptions>) => void var mockOpenURL: (url: string) => void var mockOpenToast: (text: string, type: HoliToastType, timeout: number, testID?: string) => void diff --git a/packages/ui/package.json b/packages/ui/package.json index 4e0651e8e7ead51faa584fe6d2d099878b686dd8..2fd07c0a0625eb42ecf50901281363cd78ca05fc 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -18,6 +18,7 @@ "@babel/core": "^7.23.9", "@babel/preset-env": "^7.23.9", "@react-native-community/datetimepicker": "^8.2.0", + "@storybook/react": "^7.6.10", "@types/tinycolor2": "1.4.3", "lottie-react": "2.4.0", "lottie-react-native": "6.7.0", diff --git a/yarn.lock b/yarn.lock index 0d6c8ca247ad0e0920f874e344112054eca348cf..e413c85f2886472f8955d65d22c74a00d59db21d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4436,6 +4436,7 @@ __metadata: "@babel/preset-env": "npm:^7.23.9" "@holi/icons": "npm:^1.0.0" "@react-native-community/datetimepicker": "npm:^8.2.0" + "@storybook/react": "npm:^7.6.10" "@types/tinycolor2": "npm:1.4.3" lottie-react: "npm:2.4.0" lottie-react-native: "npm:6.7.0"