From daf2055c4dd914d0f3bf66aea26e69cca08a3cc7 Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Mon, 26 Feb 2024 17:19:57 -0500 Subject: [PATCH 1/4] build(deps): Bump react-i18next from 14.0.3 to 14.0.5 Bumps [react-i18next](https://github.com/i18next/react-i18next) from 14.0.3 to 14.0.5. - [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/react-i18next/compare/v14.0.3...v14.0.5) --- updated-dependencies: - dependency-name: react-i18next dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 701b1bc11..a773f7ae5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "react-helmet-async": "^2.0.4", "react-highlight-words": "^0.20.0", "react-hook-form": "^7.50.1", - "react-i18next": "^14.0.3", + "react-i18next": "^14.0.5", "react-redux": "^8.1.3", "react-router-dom": "^6.22.0", "scrollama": "^3.2.0", @@ -25766,9 +25766,9 @@ } }, "node_modules/react-i18next": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-14.0.3.tgz", - "integrity": "sha512-Zav2EEnrQNmCawnzj0l7xitj7jipC7kBNG3o6Cl75NwGndvdp/wu3LSVwJpyAc3eSWMwRFYZ5uNi43CtFUDf/g==", + "version": "14.0.5", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-14.0.5.tgz", + "integrity": "sha512-5+bQSeEtgJrMBABBL5lO7jPdSNAbeAZ+MlFWDw//7FnVacuVu3l9EeWFzBQvZsKy+cihkbThWOAThEdH8YjGEw==", "dependencies": { "@babel/runtime": "^7.23.9", "html-parse-stringify": "^3.0.1" diff --git a/package.json b/package.json index 91b3ff1a8..f9e06fc0c 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "react-helmet-async": "^2.0.4", "react-highlight-words": "^0.20.0", "react-hook-form": "^7.50.1", - "react-i18next": "^14.0.3", + "react-i18next": "^14.0.5", "react-redux": "^8.1.3", "react-router-dom": "^6.22.0", "scrollama": "^3.2.0", From b9b671d182eade4e5c319d7e37baa7cc52f2d9c6 Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Tue, 27 Feb 2024 10:48:47 -0500 Subject: [PATCH 2/4] fix: Test fixes --- src/app.test.js | 6 ++++++ src/group/components/GroupList.test.js | 2 +- src/landscape/components/LandscapeView.test.js | 1 + src/navigation/components/Navigation.test.js | 8 +------- src/sharedData/components/SharedResourceDownload.js | 5 ----- src/storyMap/components/StoryMapForm/ShareDialog.js | 1 + 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/app.test.js b/src/app.test.js index f28babff0..c7eb6caa6 100644 --- a/src/app.test.js +++ b/src/app.test.js @@ -23,6 +23,12 @@ jest.mock('react-router-dom', () => ({ useLocation: jest.fn(), })); +jest.mock('navigation/components/Routes', () => ({ + ...jest.requireActual('navigation/components/Routes'), + __esModule: true, + default: jest.fn(), +})) + const setup = async () => { await render(, { account: { diff --git a/src/group/components/GroupList.test.js b/src/group/components/GroupList.test.js index 02b059ab1..09873c4ae 100644 --- a/src/group/components/GroupList.test.js +++ b/src/group/components/GroupList.test.js @@ -322,7 +322,7 @@ test('GroupList: URL params', async () => { }) ); await setup(); - expect(entriesSpy).toHaveBeenCalledTimes(2); + expect(entriesSpy).toHaveBeenCalled(); // Group info expect(screen.getByRole('heading', { name: 'Groups' })).toBeInTheDocument(); diff --git a/src/landscape/components/LandscapeView.test.js b/src/landscape/components/LandscapeView.test.js index 427bec93b..b6e6a1c0d 100644 --- a/src/landscape/components/LandscapeView.test.js +++ b/src/landscape/components/LandscapeView.test.js @@ -113,6 +113,7 @@ const baseViewTest = async ( .fill(0) .map((item, index) => ({ node: { + id: `sr-${index}`, source: { id: `de-${index}`, createdAt: '2022-05-20T16:25:21.536679+00:00', diff --git a/src/navigation/components/Navigation.test.js b/src/navigation/components/Navigation.test.js index 5ec83d392..464bdc2ca 100644 --- a/src/navigation/components/Navigation.test.js +++ b/src/navigation/components/Navigation.test.js @@ -92,12 +92,6 @@ test('Navigation: Test select', async () => { }); test('Navigation: Test navigation', async () => { useLocation - .mockReturnValueOnce({ - pathname: '/', - }) - .mockReturnValueOnce({ - pathname: '/', - }) .mockReturnValueOnce({ pathname: '/', }) @@ -105,7 +99,7 @@ test('Navigation: Test navigation', async () => { pathname: '/landscapes', }); await setup(); - expect(useLocation).toHaveBeenCalledTimes(4); + expect(useLocation).toHaveBeenCalled(); await act(async () => fireEvent.click(screen.getByRole('link', { name: 'Landscapes' })) ); diff --git a/src/sharedData/components/SharedResourceDownload.js b/src/sharedData/components/SharedResourceDownload.js index fc13dae69..652e4ecb0 100644 --- a/src/sharedData/components/SharedResourceDownload.js +++ b/src/sharedData/components/SharedResourceDownload.js @@ -45,11 +45,6 @@ const SharedResourceDownload = () => { if (fetchingSharedResource || sharedResource || hasToken) { return; } - console.log({ - fetchingSharedResource, - sharedResource, - hasToken, - }); const referrer = generateReferrerPath(location); const to = referrer diff --git a/src/storyMap/components/StoryMapForm/ShareDialog.js b/src/storyMap/components/StoryMapForm/ShareDialog.js index cc8e4380f..fbbdf8906 100644 --- a/src/storyMap/components/StoryMapForm/ShareDialog.js +++ b/src/storyMap/components/StoryMapForm/ShareDialog.js @@ -218,6 +218,7 @@ const ShareDialog = props => { const memberships = useMemo( () => [ { + id: 'owner-user-membership-id', user: storyMap.createdBy, userRole: MEMBERSHIP_ROLE_OWNER, }, From 1904ce6fbb02c4f6b71d99f849a94b860ebb0556 Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Tue, 27 Feb 2024 10:52:49 -0500 Subject: [PATCH 3/4] fix: Linter fix --- src/app.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.test.js b/src/app.test.js index c7eb6caa6..fd91e2123 100644 --- a/src/app.test.js +++ b/src/app.test.js @@ -27,7 +27,7 @@ jest.mock('navigation/components/Routes', () => ({ ...jest.requireActual('navigation/components/Routes'), __esModule: true, default: jest.fn(), -})) +})); const setup = async () => { await render(, { From b3f94ac009a3fc319633c25cfe49ff18b1483785 Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Tue, 27 Feb 2024 10:54:02 -0500 Subject: [PATCH 4/4] fix: Improved temp membership owner id --- src/storyMap/components/StoryMapForm/ShareDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storyMap/components/StoryMapForm/ShareDialog.js b/src/storyMap/components/StoryMapForm/ShareDialog.js index fbbdf8906..016cf7d6a 100644 --- a/src/storyMap/components/StoryMapForm/ShareDialog.js +++ b/src/storyMap/components/StoryMapForm/ShareDialog.js @@ -218,7 +218,7 @@ const ShareDialog = props => { const memberships = useMemo( () => [ { - id: 'owner-user-membership-id', + id: 'owner-user-membership', user: storyMap.createdBy, userRole: MEMBERSHIP_ROLE_OWNER, },