Open stories for scan resolution & dashboard links

This commit is contained in:
Vincent 2023-09-26 11:41:14 +02:00 коммит произвёл Vincent
Родитель f59a9b39ca
Коммит 929518fb46
2 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -5,6 +5,8 @@
import React, { useEffect } from "react";
import { Inter } from "next/font/google";
import type { Preview } from "@storybook/react";
import { action } from "@storybook/addon-actions";
import { linkTo } from "@storybook/addon-links";
import "../src/app/globals.css";
import { L10nProvider } from "../src/contextProviders/localization";
import { metropolis } from "../src/app/fonts/Metropolis/metropolis";
@ -49,6 +51,28 @@ const preview: Preview = {
nextjs: {
// See https://storybook.js.org/blog/integrate-nextjs-and-storybook-automatically/#nextnavigation
appDirectory: true,
navigation: {
push(path: string, ...otherArgs: unknown[]) {
action("nextNavigation.push")(path, ...otherArgs);
if (path === "/redesign/user/dashboard") {
linkTo(
"Pages/Dashboard",
"US user, without Premium, with unresolved scan results, with unresolved breaches"
)();
}
if (
path ===
"/redesign/user/dashboard/fix/data-broker-profiles/view-data-brokers"
) {
linkTo(
"Pages/Guided resolution/1b. Scan results",
"With a few unresolved scan results (free)"
)();
}
},
},
},
},
decorators: [AppDecorator],

Просмотреть файл

@ -42,6 +42,7 @@ const customJestConfig = {
"<rootDir>/src/db/knexfile.js",
"<rootDir>/src/apiMocks/mockData.ts",
"<rootDir>/src/(.+).stories.(ts|tsx)",
"<rootDir>/.storybook/",
// Old, pre-Next.js code assumed to be working:
"<rootDir>/src/appConstants.js",
"<rootDir>/src/views/",