diff --git a/.storybook/preview.js b/.storybook/preview.js index 65cc6b2..869436b 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -1,6 +1,6 @@ /** @type { import('@storybook/react').Preview } */ import "./style.css" -import { getMath, getComments } from "./utils"; +import { getMath, getComments, getVotesFamous } from "./utils"; // Needed at the very least for Graph component stories of UT-HAI client-deliberation. import jquery from 'jquery'; @@ -35,7 +35,7 @@ global.$.ajax = ajax_responses({ '/api/v3/math/pca2': getMath(), '/api/v3/comments': [getComments()], '/api/v3/votes': [], - '/api/v3/votes/famous': [], + '/api/v3/votes/famous': getVotesFamous(), }) const isGithubBuild = !!process.env["GITHUB_REPOSITORY"] diff --git a/.storybook/utils.js b/.storybook/utils.js index 5857408..91bf0f8 100644 --- a/.storybook/utils.js +++ b/.storybook/utils.js @@ -2,6 +2,7 @@ import * as globals from "../codebases/compdem/client-report/src/components/glob import participationData from './data/3ntrtcehas-participation-init.json' import commentsData from './data/3ntrtcehas-comments.json' import reportsData from './data/3ntrtcehas-reports.json' +import votesFamousData from './data/3ntrtcehas-votes-famous.json' // Simulates response data from /api/v3/math/pca2?conversation_id=3ntrtcehas export const getMath = () => { @@ -35,6 +36,11 @@ export const getReports = () => { return reportsData } +// Simulates response data from /api/v3/votes/famous?conversation_id=3ntrtcehas +export const getVotesFamous = () => { + return votesFamousData +} + export const getVoteColors = () => ({ agree: globals.brandColors.agree, disagree: globals.brandColors.disagree,