From 18d9b240a5c16c49daeb9b9d8e59a8f948a69a82 Mon Sep 17 00:00:00 2001 From: sumn2u Date: Tue, 25 Jun 2024 17:45:45 -0500 Subject: [PATCH 1/7] added missing license in client --- client/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/client/package.json b/client/package.json index 6de485d..a682269 100644 --- a/client/package.json +++ b/client/package.json @@ -6,6 +6,7 @@ "files": [ "dist" ], + "license": "MIT", "main": "dist/react-image-annotate.js", "dependencies": { "@emotion/react": "^11.11.4", From a01d40bf96307e177d31cbc9d2c7176598f99ae5 Mon Sep 17 00:00:00 2001 From: sumn2u Date: Tue, 25 Jun 2024 18:07:46 -0500 Subject: [PATCH 2/7] added unique key prop on point distances --- client/src/PointDistances/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/PointDistances/index.jsx b/client/src/PointDistances/index.jsx index 86e8ea2..98f42c6 100644 --- a/client/src/PointDistances/index.jsx +++ b/client/src/PointDistances/index.jsx @@ -68,7 +68,7 @@ export const PointDistances = ({ ).toFixed(pointDistancePrecision) + "%" } return ( - + Date: Tue, 25 Jun 2024 18:31:02 -0500 Subject: [PATCH 3/7] wrap region list with svg to support svg inner elements --- client/src/RegionShapes/RegionShapes.test.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/src/RegionShapes/RegionShapes.test.js b/client/src/RegionShapes/RegionShapes.test.js index 6cdaad7..343392f 100644 --- a/client/src/RegionShapes/RegionShapes.test.js +++ b/client/src/RegionShapes/RegionShapes.test.js @@ -57,13 +57,15 @@ const mockRegions = [ describe('WrappedRegionList Component', () => { it('renders without crashing', () => { const { container } = render( - + + + ); expect(container).toBeInTheDocument(); }); From 7ecb889927dd6b654a287c1c86eb3d742edceccf Mon Sep 17 00:00:00 2001 From: sumn2u Date: Tue, 25 Jun 2024 18:35:21 -0500 Subject: [PATCH 4/7] added unique key prop for keyframe timeline --- client/src/KeyframeTimeline/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/KeyframeTimeline/index.jsx b/client/src/KeyframeTimeline/index.jsx index b30b4ec..e33df8a 100644 --- a/client/src/KeyframeTimeline/index.jsx +++ b/client/src/KeyframeTimeline/index.jsx @@ -1,6 +1,6 @@ // @flow weak -import React, {useEffect, useMemo, useState} from "react" +import React, {Fragment, useEffect, useMemo, useState} from "react" import {createTheme, styled, ThemeProvider} from "@mui/material/styles" import range from "lodash/range" import * as colors from "@mui/material/colors" @@ -173,7 +173,7 @@ export default ({ {range(0, duration, majorInterval).map((a) => ( - <> + {getTimeString(a)} - + ))} {range(0, duration, minorInterval) .filter((a) => !Number.isInteger(a / majorInterval)) From 033bb4cd7de93eea4fd1535eb793bc3c3231c463 Mon Sep 17 00:00:00 2001 From: sumn2u Date: Tue, 25 Jun 2024 18:41:14 -0500 Subject: [PATCH 5/7] add missing mock translation in region selector sidebar --- .../RegionSelectorSidebarBox.test.js | 5 +++++ client/src/RegionSelectorSidebarBox/index.jsx | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/client/src/RegionSelectorSidebarBox/RegionSelectorSidebarBox.test.js b/client/src/RegionSelectorSidebarBox/RegionSelectorSidebarBox.test.js index 5ec4768..d711850 100644 --- a/client/src/RegionSelectorSidebarBox/RegionSelectorSidebarBox.test.js +++ b/client/src/RegionSelectorSidebarBox/RegionSelectorSidebarBox.test.js @@ -3,6 +3,11 @@ import { render, screen, fireEvent } from "@testing-library/react"; import "@testing-library/jest-dom"; import { RegionSelectorSidebarBox } from "./index"; +// Mock the useTranslation hook +jest.mock('react-i18next', () => ({ + useTranslation: () => ({ t: key => key }), +})); + describe("RegionSelectorSidebarBox", () => { const mockRegions = [ { diff --git a/client/src/RegionSelectorSidebarBox/index.jsx b/client/src/RegionSelectorSidebarBox/index.jsx index 46c811b..0dffbc6 100644 --- a/client/src/RegionSelectorSidebarBox/index.jsx +++ b/client/src/RegionSelectorSidebarBox/index.jsx @@ -205,7 +205,11 @@ const Row = ({ ) } - trash={ onDeleteRegion(r)} className="icon2" data-testid={`DeleteIcon-${r.id}`} /> } + trash={ + + onDeleteRegion(r)} className="icon2" data-testid={`DeleteIcon-${r.id}`} /> + + } lock={ r.locked ? ( From d0dbce688a8b7065a3f52ad0a7159592600ba3b5 Mon Sep 17 00:00:00 2001 From: sumn2u Date: Tue, 25 Jun 2024 18:42:23 -0500 Subject: [PATCH 6/7] remove debugging statement on header test --- client/src/workspace/Header/Header.test.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/client/src/workspace/Header/Header.test.js b/client/src/workspace/Header/Header.test.js index 2ff046c..81ead91 100644 --- a/client/src/workspace/Header/Header.test.js +++ b/client/src/workspace/Header/Header.test.js @@ -52,12 +52,6 @@ describe("Header", () => { items.filter((item) => item.name !== "Download").forEach((item) => { // Adjust the label to match the actual rendered text content const expectedButtonText = `Mock Icon ${item.name === "Item1" ? 1 : 2} ${item.label}`; - - // Print out the roles and names for debugging - const buttons = screen.getAllByRole("button"); - buttons.forEach((button) => { - console.log(`Role: ${button.getAttribute("role")}, Name: ${button.textContent}`); - }); expect(screen.getByRole("button", { name: expectedButtonText })).toBeInTheDocument(); expect(screen.getByText(item.label)).toBeInTheDocument(); From 3b44599d23e9450853696ed21e996840b82555ad Mon Sep 17 00:00:00 2001 From: sumn2u Date: Tue, 25 Jun 2024 19:04:31 -0500 Subject: [PATCH 7/7] suppress warning message of image drag and drop in test case --- client/src/ImageUpload/ImageUpload.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/ImageUpload/ImageUpload.test.js b/client/src/ImageUpload/ImageUpload.test.js index da60617..d8fe732 100644 --- a/client/src/ImageUpload/ImageUpload.test.js +++ b/client/src/ImageUpload/ImageUpload.test.js @@ -56,6 +56,7 @@ const renderComponent = (props = {}) => describe('ImageUpload', () => { beforeEach(() => { console.error = jest.fn() + console.warn = jest.fn() jest.clearAllMocks() })