diff --git a/client-report/src/components/app.js b/client-report/src/components/app.js
index 4b22aa822..0d36367cc 100644
--- a/client-report/src/components/app.js
+++ b/client-report/src/components/app.js
@@ -1,28 +1,20 @@
// Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see .
import React from "react";
-// import { connect } from "react-redux";
-// import probabilities from "../sampleData/probabilities";
-// import covariance from "../sampleData/covariance";
-// import correlation from "../sampleData/correlation";
-// import correlationHClust from "../sampleData/correlationHClust"
import _ from "lodash";
import * as globals from "./globals";
import URLs from "../util/url";
import DataUtils from "../util/dataUtils";
-// import Matrix from "./correlationMatrix/matrix";
import Heading from "./framework/heading.jsx";
import Footer from "./framework/Footer.jsx";
import Overview from "./overview";
import MajorityStrict from "./lists/majorityStrict.jsx";
-import Uncertainty from "./lists/uncertainty";
-import UncertaintyNarrative from "./lists/uncertaintyNarrative";
+import Uncertainty from "./lists/uncertainty.jsx";
+import UncertaintyNarrative from "./lists/uncertaintyNarrative.jsx";
import AllCommentsModeratedIn from "./lists/allCommentsModeratedIn.jsx";
import ParticipantGroups from "./lists/participantGroups.jsx";
-// import CommentsGraph from "./commentsGraph/commentsGraph";
import ParticipantsGraph from "./participantsGraph/participantsGraph";
-// import BoxPlot from "./boxPlot/boxPlot";
import Beeswarm from "./beeswarm/beeswarm.jsx";
import Controls from "./controls/controls.jsx";
diff --git a/client-report/src/components/lists/uncertainty.js b/client-report/src/components/lists/uncertainty.jsx
similarity index 95%
rename from client-report/src/components/lists/uncertainty.js
rename to client-report/src/components/lists/uncertainty.jsx
index d7c9a41db..6cebc7821 100644
--- a/client-report/src/components/lists/uncertainty.js
+++ b/client-report/src/components/lists/uncertainty.jsx
@@ -2,9 +2,9 @@
import React from "react";
import CommentList from "./commentList.jsx";
-import * as globals from "../globals";
+import * as globals from "../globals.js";
// import style from "../../util/style";
-import Narrative from "../narrative";
+import Narrative from "../narrative/index.js";
const Uncertainty = ({
conversation,
diff --git a/client-report/src/components/lists/uncertaintyNarrative.js b/client-report/src/components/lists/uncertaintyNarrative.jsx
similarity index 94%
rename from client-report/src/components/lists/uncertaintyNarrative.js
rename to client-report/src/components/lists/uncertaintyNarrative.jsx
index 3ea454977..d77acbe05 100644
--- a/client-report/src/components/lists/uncertaintyNarrative.js
+++ b/client-report/src/components/lists/uncertaintyNarrative.jsx
@@ -2,15 +2,13 @@
import React from "react";
import CommentList from "./commentList.jsx";
-import * as globals from "../globals";
-// import style from "../../util/style";
-import Narrative from "../narrative";
+import * as globals from "../globals.js";
+import Narrative from "../narrative/index.js";
const UncertaintyNarrative = ({
conversation,
comments,
ptptCount,
- uncertainty,
formatTid,
math,
voteColors,
diff --git a/client-report/src/components/lists/uncertaintyNarrative.test.jsx b/client-report/src/components/lists/uncertaintyNarrative.test.jsx
new file mode 100644
index 000000000..d5c028d43
--- /dev/null
+++ b/client-report/src/components/lists/uncertaintyNarrative.test.jsx
@@ -0,0 +1,49 @@
+import React from 'react';
+import { render, screen } from '@testing-library/react';
+import UncertaintyNarrative from './uncertaintyNarrative';
+import * as globals from '../globals.js'; // Mock globals if necessary
+jest.mock('../narrative/index.js', () => ({ model }) =>
); // Mock Narrative
+jest.mock('./commentList.jsx', () => () => );
+import '@testing-library/jest-dom';
+
+describe('UncertaintyNarrative Component', () => {
+ const mockProps = {
+ conversation: {},
+ comments: {},
+ ptptCount: 100,
+ formatTid: jest.fn((tid) => `TID${tid}`),
+ math: {},
+ voteColors: {},
+ narrative: {
+ uncertainty: {
+ responseClaude: { content: [{ text: '"paragraphs":[{"sentences":[{"clauses":[{"citations":["T1","T2"]}]}]}]}' }] },
+ responseGemini: '{"paragraphs":[{"sentences":[{"clauses":[{"citations":["T3"]}]}]}]}'
+ }
+ },
+ model: 'claude'
+ };
+
+ it('renders loading message when data is missing', () => {
+ render();
+ expect(screen.getByText('Loading Uncertainty...')).toBeInTheDocument();
+ });
+
+ it('renders component with narrative and comment list when data is present (Claude model)', () => {
+ render();
+
+ expect(screen.getByText('Uncertainty Narrative')).toBeInTheDocument();
+ expect(screen.getByText('This narrative summary may contain hallucinations. Check each clause.')).toBeInTheDocument();
+ expect(screen.getByTestId('mock-narrative-claude')).toBeInTheDocument();
+ expect(screen.getByTestId('mock-comment-list')).toBeInTheDocument();
+ });
+
+ it('renders component with narrative and comment list when data is present (Gemini model)', () => {
+ render();
+
+ expect(screen.getByText('Uncertainty Narrative')).toBeInTheDocument();
+ expect(screen.getByText('This narrative summary may contain hallucinations. Check each clause.')).toBeInTheDocument();
+ expect(screen.getByTestId('mock-narrative-gemini')).toBeInTheDocument();
+ expect(screen.getByTestId('mock-comment-list')).toBeInTheDocument();
+ });
+
+});
\ No newline at end of file