diff --git a/package.json b/package.json index 5df4e21cf..f0340d86e 100644 --- a/package.json +++ b/package.json @@ -193,4 +193,4 @@ "node": ">=20" }, "packageManager": "yarn@3.6.4" -} +} \ No newline at end of file diff --git a/packages/components/vite.config.ts b/packages/components/vite.config.ts index ee42e0045..dfff2f379 100644 --- a/packages/components/vite.config.ts +++ b/packages/components/vite.config.ts @@ -16,6 +16,9 @@ const vitestConfig: VitestUserConfigInterface = { }, include: ['./src/**/*.test.?(c|m)[jt]s?(x)'], logHeapUsage: true, + sequence: { + hooks: 'list', + }, }, } // eslint-disable-next-line import/no-default-export diff --git a/src/pages/Research/Content/ResearchArticle.test.tsx b/src/pages/Research/Content/ResearchArticle.test.tsx index fad3bdc1c..97f74392a 100644 --- a/src/pages/Research/Content/ResearchArticle.test.tsx +++ b/src/pages/Research/Content/ResearchArticle.test.tsx @@ -143,7 +143,7 @@ describe('Research Article', () => { // Assert await waitFor(() => { - expect(wrapper.getAllByText('With contributions from:')).toHaveLength(1) + expect(wrapper.getAllByText('With contributions from')).toHaveLength(1) expect(wrapper.getAllByText('example-username')).toHaveLength(2) expect(wrapper.getAllByText('another-example-username')).toHaveLength(2) expect(wrapper.getAllByTestId('Username: known flag')).toHaveLength(4) @@ -241,15 +241,24 @@ describe('Research Article', () => { }) // Assert - await waitFor(() => { - expect(wrapper.getAllByText('With contributions from:')).toHaveLength(1) - expect(wrapper.getAllByText('example-username')).toHaveLength(2) - expect(wrapper.getAllByText('another-example-username')).toHaveLength(2) - expect(wrapper.getAllByText('third-example-username')).toHaveLength(1) - expect(wrapper.queryByText('fourth-example-username')).toBeNull() - expect(wrapper.getAllByTestId('collaborator/creator')).toHaveLength(1) - expect(wrapper.getAllByTestId('Username: known flag')).toHaveLength(5) - }) + await waitFor( + () => { + expect(wrapper.getAllByText('With contributions from')).toHaveLength( + 1, + ) + expect(wrapper.getAllByText('example-username')).toHaveLength(2) + expect(wrapper.getAllByText('another-example-username')).toHaveLength( + 2, + ) + expect(wrapper.getAllByText('third-example-username')).toHaveLength(1) + expect(wrapper.queryByText('fourth-example-username')).toBeNull() + expect(wrapper.getAllByTestId('collaborator/creator')).toHaveLength(1) + expect(wrapper.getAllByTestId('Username: known flag')).toHaveLength(5) + }, + { + timeout: 10000, + }, + ) }) it('does not show edit timestamp, when create displays the same value', async () => { diff --git a/src/stores/Maps/filter.test.ts b/src/stores/Maps/filter.test.ts index 8aaa06b24..2581c5ea1 100644 --- a/src/stores/Maps/filter.test.ts +++ b/src/stores/Maps/filter.test.ts @@ -33,7 +33,7 @@ describe('filterMapPinsByType', () => { it('returns only verified pins', () => { const mapPins: Partial[] = [ - { _deleted: false, type: 'member', verified: true }, + { _deleted: false, type: 'collection-point', verified: true }, { _deleted: false, type: 'machine-builder' }, ] expect( diff --git a/src/stores/Maps/filter.ts b/src/stores/Maps/filter.ts index 85663c746..53d180977 100644 --- a/src/stores/Maps/filter.ts +++ b/src/stores/Maps/filter.ts @@ -4,10 +4,7 @@ import type { IMapPin } from 'src/models/maps.models' // filter pins to include matched pin type or subtype // excluding items which have been marked as deleted=true -export const filterMapPinsByType = ( - mapPins: IMapPin[], - filters: Array, -) => { +export const filterMapPinsByType = (mapPins: IMapPin[], filters: string[]) => { const filterList = new Set(filters) let filteredPins = mapPins diff --git a/vite.config.ts b/vite.config.ts index 1b23511e5..236569e2d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -25,6 +25,9 @@ const vitestConfig: VitestUserConfigInterface = { }, include: ['./src/**/*.test.?(c|m)[jt]s?(x)'], logHeapUsage: true, + sequence: { + hooks: 'list', + }, }, }