diff --git a/src/components/Points/PointCard.jsx b/src/components/Points/PointCard.jsx index ad08c2a1..632dfcbc 100644 --- a/src/components/Points/PointCard.jsx +++ b/src/components/Points/PointCard.jsx @@ -65,6 +65,7 @@ const PointCard = (props) => { )} {Object.keys(point.payload).length === 0 && ( diff --git a/src/components/Points/PointsTabs.jsx b/src/components/Points/PointsTabs.jsx index 763b380a..2e38dc85 100644 --- a/src/components/Points/PointsTabs.jsx +++ b/src/components/Points/PointsTabs.jsx @@ -170,6 +170,7 @@ const PointsTabs = ({ collectionName, client }) => { { + it('should render score when it is present', () => { + render( + + + + ); + expect(screen.getByText('Point 10')).toBeInTheDocument(); + expect(screen.getByText('Score: 0.9621345')).toBeInTheDocument(); + }); + + it('should not render score when it is not available', async () => { + render( + + + + ); + expect(screen.getByText('Point 11')).toBeInTheDocument(); + expect(screen.queryByText('Score') === null); + expect(screen.queryByText('Score: undefined') === null); + }); +}); diff --git a/vite.config.js b/vite.config.js index bd0d8d83..aae734d3 100644 --- a/vite.config.js +++ b/vite.config.js @@ -41,6 +41,12 @@ export default defineConfig(async () => { globals: true, environment: 'jsdom', setupFiles: ['./src/setupTests.js'], + alias: [ + { + find: /^monaco-editor$/, + replacement: __dirname + '/node_modules/monaco-editor/esm/vs/editor/editor.api', + }, + ], }, - } + }; });