diff --git a/.husky/pre-commit b/.husky/pre-commit
index bfc028b7..fac4de58 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1,2 @@
-#!/usr/bin/env sh
-. "$(dirname -- "$0")/_/husky.sh"
-
-yarn test
+cd packages/react
+yarn run lint
\ No newline at end of file
diff --git a/apps/smithy/.storybook/main.ts b/apps/smithy/.storybook/main.ts
index 030eb214..092e540e 100644
--- a/apps/smithy/.storybook/main.ts
+++ b/apps/smithy/.storybook/main.ts
@@ -1,7 +1,14 @@
import path from "path";
// SEE: https://storybook.js.org/docs/react/faq#how-do-i-fix-module-resolution-in-special-environments
-const getAbsolutePath = (packageName) =>
+import { createRequire } from 'module';
+const require = createRequire(import.meta.url);
+
+// Utility to resolve the absolute path of a given package. Storybook requires absolute
+// addon paths when the config file is executed in an ESM context (Node ≥ 18 / SB 8).
+// We can still rely on Node's `require.resolve` by creating a CommonJS `require`
+// function that is bound to this ESM module.
+const getAbsolutePath = (packageName: string) =>
path.dirname(require.resolve(path.join(packageName, "package.json")));
/** @type { import('@storybook/react-vite').StorybookConfig } */
diff --git a/apps/smithy/.storybook/preview.jsx b/apps/smithy/.storybook/preview.jsx
deleted file mode 100644
index eb229bc0..00000000
--- a/apps/smithy/.storybook/preview.jsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import "./global.css";
-
-import * as React from "react";
-import { useEffect } from "react";
-import { Provider } from "@frigade/react";
-
-// LOCAL DEV
-// const FRIGADE_API_KEY =
-// "api_public_0FaxqVs527bAVQsFK4RcuJYjVqHeC5U7CGJLfsVXRE36eAKiLjwAEugZYeFijCI2";
-// const API_URL = "https://localhost:3443/v1/public";
-
-// FRIGADE DEV
-const FRIGADE_API_KEY =
- "api_public_GY6O5JS99XTL2HAXU0D6OQHYQ7I706P5I9C9I7CEZFNFUFRARD2DVDSMFW3YT3SV";
-const API_URL = "https://api.frigade.com";
-
-// const userId = `jonathan_livingston_smeagol`;
-const userId = `jonathan_livingston_smeagol_${Math.random()
- .toString(36)
- .substring(2, 9)}`;
-
-const preview = {
- parameters: {
- actions: { argTypesRegex: "^on[A-Z].*" },
- controls: {
- matchers: {
- color: /(background|color)$/i,
- date: /Date$/,
- },
- },
- },
- decorators: [
- (Story) => {
- const [delayedUserId, setDelayedUserId] = React.useState(undefined);
-
- useEffect(() => {
- setTimeout(() => {
- setDelayedUserId(userId);
- }, 1000);
- }, []);
-
- return (
-
-
-
- );
- },
- ],
-};
-
-export default preview;
diff --git a/apps/smithy/.storybook/preview.tsx b/apps/smithy/.storybook/preview.tsx
index 16d6f4fb..f839e164 100644
--- a/apps/smithy/.storybook/preview.tsx
+++ b/apps/smithy/.storybook/preview.tsx
@@ -1,5 +1,5 @@
import * as React from "react";
-import { FrigadeJS, Provider } from "@frigade/react";
+import { FrigadeJS, Provider, useFlow } from "@frigade/react";
import "./global.css";
@@ -35,9 +35,26 @@ const preview = {
apiKey={FRIGADE_API_KEY}
apiUrl={FRIGADE_API_URL}
defaultCollection={true}
- // generateGuestId={false}
+ // generateGuestId={true}
userId={FRIGADE_USER_ID}
// syncOnWindowUpdates={false}
+
+ // theme={{
+ // colors: {
+ // primary: {
+ // surface: "pink",
+ // active: {
+ // surface: "teal",
+ // },
+ // hover: {
+ // surface: "orange",
+ // },
+ // },
+ // },
+ // }}
+
+ // themeSelector="#storybook-root"
+
userProperties={{
firstName: "Jonathan",
lastName: "Livingston",
diff --git a/apps/smithy/package.json b/apps/smithy/package.json
index dc09e534..10651e20 100644
--- a/apps/smithy/package.json
+++ b/apps/smithy/package.json
@@ -12,33 +12,33 @@
},
"dependencies": {
"@frigade/react": "workspace:*",
- "react": "^18.2.0",
- "react-dom": "^18.2.0"
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0"
},
"devDependencies": {
- "@storybook/addon-docs": "^8.2.9",
- "@storybook/addon-essentials": "^8.2.9",
- "@storybook/addon-interactions": "^8.2.9",
- "@storybook/addon-links": "^8.2.9",
- "@storybook/blocks": "^8.2.9",
- "@storybook/cli": "^8.2.9",
- "@storybook/react": "^8.2.9",
- "@storybook/react-vite": "^8.2.9",
- "@storybook/test": "^8.2.9",
- "@storybook/test-runner": "^0.19.1",
- "@types/react": "^18.2.34",
- "@types/react-dom": "^18.2.14",
- "@typescript-eslint/eslint-plugin": "^6.0.0",
- "@typescript-eslint/parser": "^6.0.0",
+ "@storybook/addon-docs": "^8.5.3",
+ "@storybook/addon-essentials": "^8.5.3",
+ "@storybook/addon-interactions": "^8.5.3",
+ "@storybook/addon-links": "^8.5.3",
+ "@storybook/blocks": "^8.5.3",
+ "@storybook/cli": "^8.5.3",
+ "@storybook/react": "^8.5.3",
+ "@storybook/react-vite": "^8.5.3",
+ "@storybook/test": "^8.5.3",
+ "@storybook/test-runner": "^0.21.0",
+ "@types/react": "^19.0.0",
+ "@types/react-dom": "^19.0.0",
+ "@typescript-eslint/eslint-plugin": "^6.20.0",
+ "@typescript-eslint/parser": "^6.20.0",
"@vitejs/plugin-react": "^4.0.3",
- "eslint": "^8.45.0",
+ "eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.0",
- "eslint-plugin-react-refresh": "^0.4.3",
- "eslint-plugin-storybook": "^0.8.0",
- "playwright": "^1.47.1",
+ "eslint-plugin-react-refresh": "^0.4.5",
+ "eslint-plugin-storybook": "^0.11.2",
+ "playwright": "^1.55.1",
"prop-types": "^15.8.1",
- "storybook": "^8.2.9",
+ "storybook": "^8.5.3",
"typescript": "^4.9.4",
- "vite": "^4.5.5"
+ "vite": "^4.5.14"
}
}
diff --git a/apps/smithy/src/stories/Announcement/Announcement.stories.tsx b/apps/smithy/src/stories/Announcement/Announcement.stories.tsx
index c47b0d06..1e99149e 100644
--- a/apps/smithy/src/stories/Announcement/Announcement.stories.tsx
+++ b/apps/smithy/src/stories/Announcement/Announcement.stories.tsx
@@ -1,4 +1,5 @@
-import { Announcement, useFlow, useFrigade } from "@frigade/react";
+import { Announcement, Tour, useFlow, useFrigade } from "@frigade/react";
+import { useEffect } from "react";
export default {
title: "Components/Announcement",
@@ -8,7 +9,7 @@ export default {
export const Default = {
args: {
dismissible: true,
- flowId: "flow_8Ybz7lMK",
+ flowId: "flow_vLivpwoH",
modal: true,
onDismiss: () => console.log("Dismissed"),
},
@@ -24,6 +25,25 @@ export const TestReset = {
const { frigade } = useFrigade();
const { flow } = useFlow(args.flowId);
+ useEffect(() => {
+ frigade.on("step.start", (event, flow, previousFlow, step) => {
+ console.log("step.start", event, flow.id, step?.id);
+ });
+ frigade.on("step.complete", (event, flow, previousFlow, step) => {
+ console.log("step.complete", event, flow.id, step?.id);
+ });
+
+ frigade.on("flow.start", (event, flow) => {
+ console.log("flow.start", event, flow.id);
+ });
+ frigade.on("flow.complete", (event, flow) => {
+ console.log("flow.complete", event, flow.id);
+ });
+ frigade.on("flow.skip", (event, flow) => {
+ console.log("flow.skip", event, flow.id);
+ });
+ }, []);
+
return (
@@ -52,8 +72,10 @@ export const ModalCollisions = {
return (
-
+
+
+
+
+
Tour anchor
);
},
diff --git a/apps/smithy/src/stories/Checklist/Checklist.stories.tsx b/apps/smithy/src/stories/Checklist/Checklist.stories.tsx
index 913f4dde..cbfe2758 100644
--- a/apps/smithy/src/stories/Checklist/Checklist.stories.tsx
+++ b/apps/smithy/src/stories/Checklist/Checklist.stories.tsx
@@ -64,7 +64,6 @@ export const Collapsible = {
test: TestStep,
},
width: "500px",
- forceMount: true,
dismissible: true,
},
};
diff --git a/apps/smithy/src/stories/Checklist/ChecklistInteractionTests.stories.tsx b/apps/smithy/src/stories/Checklist/ChecklistInteractionTests.stories.tsx
new file mode 100644
index 00000000..be732623
--- /dev/null
+++ b/apps/smithy/src/stories/Checklist/ChecklistInteractionTests.stories.tsx
@@ -0,0 +1,74 @@
+import { Checklist, useFlow } from "@frigade/react";
+import { type Meta, type StoryObj } from "@storybook/react";
+import { expect, userEvent, within } from "@storybook/test";
+
+type ChecklistStory = StoryObj
;
+
+function sleep(ms: number) {
+ return new Promise((resolve) => setTimeout(resolve, ms));
+}
+
+const StoryMeta: Meta = {
+ title: "Components/Checklist",
+ component: Checklist.Collapsible,
+};
+
+export default StoryMeta;
+
+export const InteractionTests: ChecklistStory = {
+ args: {
+ flowId: "flow_K2dmIlteW8eGbGoo",
+ },
+ decorators: [
+ (Story, { args }) => {
+ const { flow } = useFlow(args.flowId);
+
+ return (
+ <>
+
+
+ >
+ );
+ },
+ ],
+
+ play: async ({ step, canvasElement }) => {
+ await sleep(1000);
+ const canvas = within(canvasElement);
+ const checklistElement = document.querySelector(".fr-checklist");
+
+ await step("Test interactions", async () => {
+ // test that checklistElement is in the document
+ expect(checklistElement).toBeInTheDocument();
+
+ const lastHeader = canvas.getByText("Donec id diam lectus");
+ let checkboxes = document.querySelectorAll(".fr-field-radio-value");
+
+ // expectd lastCheckbox to not have any children
+ expect(checkboxes[checkboxes.length - 1]?.childNodes.length).toBe(0);
+ // click last header
+ await userEvent.click(lastHeader);
+ // Click the primary button that says "Testing"
+ await userEvent.click(canvas.getByText("Testing"));
+ await sleep(100);
+
+ checkboxes = document.querySelectorAll(".fr-field-radio-value");
+ // expect lastCheckbox to have a child (it is checked)
+ expect(
+ checkboxes[checkboxes.length - 1]?.childNodes.length
+ ).toBeGreaterThanOrEqual(1);
+ await sleep(1000);
+ expect(checklistElement).toBeInTheDocument();
+
+ await userEvent.click(canvas.getByText("Reset Flow"));
+ });
+ },
+};
diff --git a/apps/smithy/src/stories/Checklist/Floating.stories.tsx b/apps/smithy/src/stories/Checklist/Floating.stories.tsx
new file mode 100644
index 00000000..fc42d3fe
--- /dev/null
+++ b/apps/smithy/src/stories/Checklist/Floating.stories.tsx
@@ -0,0 +1,21 @@
+import { Box, Checklist } from "@frigade/react";
+import { type Meta } from "@storybook/react";
+
+export default {
+ title: "Components/Checklist/Floating",
+ component: Checklist.Floating,
+ decorators: [
+ (Story) => (
+
+
+
+ ),
+ ],
+} as Meta;
+
+export const Default = {
+ args: {
+ //children: ,
+ flowId: "flow_K2dmIlteW8eGbGoo",
+ },
+};
diff --git a/apps/smithy/src/stories/Collection/Collection.stories.tsx b/apps/smithy/src/stories/Collection/Collection.stories.tsx
index 45ef5ff4..11d1248e 100644
--- a/apps/smithy/src/stories/Collection/Collection.stories.tsx
+++ b/apps/smithy/src/stories/Collection/Collection.stories.tsx
@@ -176,7 +176,7 @@ export const MultipleAnnouncements = {
{/* Storybook X & Y Announcements */}
-
+ {/* */}
>
),
],
diff --git a/apps/smithy/src/stories/Collection/CollectionInteractionTests.stories.tsx b/apps/smithy/src/stories/Collection/CollectionInteractionTests.stories.tsx
index a8e1eaf0..5d9e2bef 100644
--- a/apps/smithy/src/stories/Collection/CollectionInteractionTests.stories.tsx
+++ b/apps/smithy/src/stories/Collection/CollectionInteractionTests.stories.tsx
@@ -112,7 +112,7 @@ export const InteractionTests: CollectionStory = {
"Test that the default collection can render url-based announcement",
async () => {
const canvas = within(document.body);
- await sleep(300);
+ await sleep(500);
await expect(canvas.queryByRole("dialog")).not.toBeInTheDocument();
await userEvent.click(
@@ -151,6 +151,8 @@ export const InteractionTests: CollectionStory = {
// expect banner to contain the text "Banner title"
await expect(banner.getByText("Banner title")).toBeInTheDocument();
+ await sleep(200);
+
// Click button with Primary CTA
await userEvent.click(
banner.getByRole("button", {
diff --git a/apps/smithy/src/stories/Form/Form.stories.tsx b/apps/smithy/src/stories/Form/Form.stories.tsx
index f96df805..ca316668 100644
--- a/apps/smithy/src/stories/Form/Form.stories.tsx
+++ b/apps/smithy/src/stories/Form/Form.stories.tsx
@@ -5,7 +5,7 @@ import {
type FormFieldProps,
SelectField,
} from "@frigade/react";
-import { useState } from "react";
+import { useEffect, useState } from "react";
export default {
title: "Components/Form",
@@ -32,7 +32,7 @@ export const Default = {
fieldTypes: {
customTest: CustomStep,
},
- as: Dialog,
+ // as: Dialog,
variables: {
testVar: "hello world",
},
@@ -84,6 +84,7 @@ export const CustomForm = {
console.log("Secondary");
return true;
},
+ onComplete: (e, properties) => console.log("Complete", e, properties),
},
};
@@ -114,11 +115,20 @@ export const VariablesInForms = {
const [testVar, setTestVar] = useState("test1");
const [otherVar, setOtherVar] = useState("test2");
- // setTimeout to simulate async data fetching
- setTimeout(() => {
- setTestVar("updated var 1");
- setOtherVar("updated var 2");
- }, 1000);
+ useEffect(() => {
+ // setTimeout to simulate async data fetching
+ setTimeout(() => {
+ setTestVar("updated var 1");
+ setOtherVar("updated var 2");
+ }, 1000);
+
+ // update it again after 2000ms
+ setTimeout(() => {
+ setTestVar("updated var 1 again");
+ setOtherVar("updated var 2 again");
+ }, 2000);
+ }, []);
+ ``;
return (
diff --git a/apps/smithy/src/stories/Form/FormInteractionTests.stories.tsx b/apps/smithy/src/stories/Form/FormInteractionTests.stories.tsx
index 8e0be290..8fe58ed1 100644
--- a/apps/smithy/src/stories/Form/FormInteractionTests.stories.tsx
+++ b/apps/smithy/src/stories/Form/FormInteractionTests.stories.tsx
@@ -1,6 +1,6 @@
import { Form, useFlow } from "@frigade/react";
import { type Meta, type StoryObj } from "@storybook/react";
-import { expect, userEvent, within } from "@storybook/test";
+import { expect, userEvent, waitFor, within } from "@storybook/test";
type FormStory = StoryObj
;
@@ -44,19 +44,35 @@ export const InteractionTests: FormStory = {
play: async ({ step }) => {
await step("Test linear flow of Form", async () => {
const canvas = within(document.body);
- await sleep(500);
+
await canvas.findByText("This is page 1");
await userEvent.click(canvas.getByText("Continue to page 2"));
await userEvent.click(canvas.getByText("Next"));
+
await canvas.findByText("This is page 2");
await userEvent.click(canvas.getByText("Next"));
+
await canvas.findByText("This is page 3");
- await sleep(100);
- await expect(canvas.getByText("Finish").closest("button")).toBeDisabled();
+
+ const finishButton = await canvas.findByRole("button", {
+ name: "Finish",
+ });
+
+ await waitFor(async () => {
+ await expect(finishButton).toBeDisabled();
+ });
+
await userEvent.click(canvas.getByText("Radio 1"));
- await userEvent.click(canvas.getByText("Finish"));
- await sleep(500);
- await expect(document.querySelector(".fr-form")).not.toBeInTheDocument();
+ await userEvent.click(finishButton);
+
+ await waitFor(async () => {
+ await expect(
+ document.querySelector(".fr-form")
+ ).not.toBeInTheDocument();
+ });
+
+ await sleep(1000);
+
await userEvent.click(canvas.getByText("Reset Flow"));
await sleep(1000);
});
@@ -74,6 +90,49 @@ export const InteractionTests: FormStory = {
await expect(document.querySelector(".fr-form")).not.toBeInTheDocument();
await userEvent.click(canvas.getByText("Reset Flow"));
await sleep(1000);
+ await userEvent.click(canvas.getByText("Reset Flow"));
+ await sleep(1000);
});
+
+ // test navigating back and forth 3 times between step 1 and 2
+ await step(
+ "Test navigating back and forth 3 times between step 1 and 2",
+ async () => {
+ const canvas = within(document.body);
+
+ for (let i = 0; i < 3; i++) {
+ await canvas.findByText(
+ "This is page 1",
+ {},
+ { timeout: 5000, interval: 500 }
+ );
+ await userEvent.click(canvas.getByText("Continue to page 2"));
+ await userEvent.click(canvas.getByText("Next"));
+ await canvas.findByText(
+ "This is page 2",
+ {},
+ { timeout: 5000, interval: 500 }
+ );
+ await userEvent.click(canvas.getByText("Back"));
+ }
+
+ // now finish the flow
+ await canvas.findByText("This is page 1");
+ await userEvent.click(canvas.getByText("Continue to page 2"));
+ await userEvent.click(canvas.getByText("Next"));
+ await canvas.findByText("This is page 2");
+ await userEvent.click(canvas.getByText("Next"));
+ await canvas.findByText("This is page 3");
+ await userEvent.click(canvas.getByText("Radio 1"));
+ await userEvent.click(canvas.getByText("Finish"));
+ await sleep(500);
+ await expect(
+ document.querySelector(".fr-form")
+ ).not.toBeInTheDocument();
+
+ await userEvent.click(canvas.getByText("Reset Flow"));
+ await sleep(1000);
+ }
+ );
},
};
diff --git a/apps/smithy/src/stories/Hint/Hint.stories.tsx b/apps/smithy/src/stories/Hint/Hint.stories.tsx
index b5aee7ff..9de8a467 100644
--- a/apps/smithy/src/stories/Hint/Hint.stories.tsx
+++ b/apps/smithy/src/stories/Hint/Hint.stories.tsx
@@ -12,7 +12,7 @@ export const Default = {
alignOffset: 0,
anchor: "#tooltip-storybook-0",
children: Hello,
- defaultOpen: false,
+ defaultOpen: true,
side: "left",
sideOffset: 0,
},
diff --git a/apps/smithy/src/stories/Popover/Popover.stories.tsx b/apps/smithy/src/stories/Popover/Popover.stories.tsx
new file mode 100644
index 00000000..055f5f38
--- /dev/null
+++ b/apps/smithy/src/stories/Popover/Popover.stories.tsx
@@ -0,0 +1,75 @@
+import { Meta, StoryObj } from "@storybook/react";
+import { Box, Button, Card, FloatingUI, Popover } from "@frigade/react";
+
+const meta: Meta = {
+ title: "Design System/Popover",
+ parameters: {
+ layout: "centered",
+ },
+};
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {
+ render: () => (
+
+
+
+ Popover.Trigger
+
+
+
+ Popover.Content
+
+
+
+
+ ),
+};
+
+export const Nested: Story = {
+ render: () => (
+
+
+
+
+ Popover.Trigger
+
+
+
+ Popover.Content
+
+
+ Nested Popover.Trigger
+
+
+
+ Nested Popover.Content
+
+
+
+
+
+
+
+
+ ),
+};
+
+export const AutoScroll: Story = {
+ render: () => (
+
+
+
+ Popover.Trigger
+
+
+
+ Popover.Content
+
+
+
+
+ ),
+};
diff --git a/apps/smithy/src/stories/Progress/Progress.stories.tsx b/apps/smithy/src/stories/Progress/Progress.stories.tsx
index ff75c678..a269ba6f 100644
--- a/apps/smithy/src/stories/Progress/Progress.stories.tsx
+++ b/apps/smithy/src/stories/Progress/Progress.stories.tsx
@@ -1,4 +1,4 @@
-import { Flex, Progress } from "@frigade/react";
+import { Flex, Progress, Text } from "@frigade/react";
export default {
title: "Design System/Progress",
@@ -13,9 +13,30 @@ export const Default = {
decorators: [
(_, { args }) => (
-
-
-
+
+ Progress.Bar
+
+
+
+ Progress.Dots
+
+
+
+ Progress.Segments
+
+
+
+ Progress.Ring
+
+
+
+
+
),
],
diff --git a/apps/smithy/src/stories/Survey/Survey.stories.tsx b/apps/smithy/src/stories/Survey/Survey.stories.tsx
index 8a6a91b3..6b03ca28 100644
--- a/apps/smithy/src/stories/Survey/Survey.stories.tsx
+++ b/apps/smithy/src/stories/Survey/Survey.stories.tsx
@@ -8,13 +8,21 @@ export default {
export const NPS = {
args: {
+ flowId: "flow_SJjL59eSt9A112vJ",
dismissible: true,
+ options: [
+ { label: "😞", value: "0" },
+ { label: "😕", value: "1" },
+ { label: "😐", value: "2" },
+ { label: "🙂", value: "3" },
+ { label: "😍", value: "4" },
+ ],
},
decorators: [
(_: StoryFn, options: StoryContext) => {
return (
-
+
Other elements on the page
{
@@ -24,7 +32,7 @@ export const NPS = {
Change url
{
- // const [open, setOpen] = useState(true);
+ const [, setForceRender] = useState(Math.random());
+ const [open, setOpen] = useState(true);
// const { flow } = useFlow("flow_U63A5pndRrvCwxNs");
const lateAnchorRef = useRef(null);
useEffect(() => {
- // @ts-expect-error Shush TypeScript, it's a debug ref in a story, it's fine
- lateAnchorRef.current = (
-
- {
- // no-op
- }}
- />
-
- );
+ setTimeout(() => {
+ // @ts-expect-error Shush TypeScript, it's a debug ref in a story, it's fine
+ lateAnchorRef.current = (
+
+ {
+ // no-op
+ }}
+ />
+
+ );
+
+ setForceRender(Math.random());
+ }, 1000);
}, []);
return (
@@ -77,11 +84,12 @@ export const Default = {
Second anchor
setOpen(false)}
{...(options.args as TourProps)}
/>
@@ -92,7 +100,7 @@ export const Default = {
style={{
background: "lightgreen",
width: "200px",
- marginTop: "1400px", // Add significant margin to force scrolling
+ marginTop: "200vh", // Add significant margin to force scrolling
}}
>
Scroll to see this anchor
@@ -102,3 +110,120 @@ export const Default = {
},
],
};
+
+export const AnchorNotFound = {
+ args: {
+ autoScroll: true,
+ flowId: "flow_U63A5pndRrvCwxNs",
+ defaultOpen: true,
+ },
+ decorators: [
+ (_: StoryFn, options: StoryContext) => {
+ return (
+ <>
+
+
+ {
+ // no-op
+ }}
+ />
+
+
+
+ >
+ );
+ },
+ ],
+};
+
+export const WithScrollContainer = {
+ args: {
+ autoScroll: true,
+ container: "#tour-scroll-container",
+ flowId: "flow_U63A5pndRrvCwxNs",
+ modal: false,
+ spotlight: false,
+ variables: {
+ firstName: "Euronymous Bosch",
+ },
+ },
+ decorators: [
+ (_: StoryFn, options: StoryContext) => {
+ return (
+ <>
+
+
+
+
+ {
+ // no-op
+ }}
+ />
+
+
+
+ Second anchor
+
+
+
+ Scroll to see this anchor
+
+
+
+
+
+ >
+ );
+ },
+ ],
+};
diff --git a/apps/smithy/src/stories/Tour/TourInteractionTests.stories.tsx b/apps/smithy/src/stories/Tour/TourInteractionTests.stories.tsx
index 84335c2c..5503ddfb 100644
--- a/apps/smithy/src/stories/Tour/TourInteractionTests.stories.tsx
+++ b/apps/smithy/src/stories/Tour/TourInteractionTests.stories.tsx
@@ -16,7 +16,7 @@ const StoryMeta: Meta = {
export default StoryMeta;
-export const InteractionTests: TourStory = {
+export const AnchorFoundInteractionTests: TourStory = {
args: {
flowId: "flow_U63A5pndRrvCwxNs",
},
@@ -24,6 +24,7 @@ export const InteractionTests: TourStory = {
decorators: [
(Story, { args }) => {
const { flow } = useFlow(args.flowId);
+ args.flow = flow;
const lateAnchorRef = useRef(null);
@@ -52,7 +53,7 @@ export const InteractionTests: TourStory = {