Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions cunningham.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export const commonTokenOverrides = {
"body--background-color-hover":
"ref(contextuals.background.semantic.neutral.tertiary)",
},
"forms-fileuploader": {
"border-style": "solid",
"border-radius": "4px",
"border-width": "1px",
},
"forms-checkbox": {
"font-size": "ref(globals.font.sizes.sm)",
},
Expand Down Expand Up @@ -487,7 +492,7 @@ export const whiteLabelGlobals = {
"white-850": "#F8F8F9D9",
"white-900": "#F8F8F9E5",
"white-950": "#F8F8F9F2",
"white-975": "#F8F8F9F9"
"white-975": "#F8F8F9F9",
},
...commonGlobals,
font: {
Expand All @@ -496,7 +501,7 @@ export const whiteLabelGlobals = {
base: "Hanken Grotesk, Inter, Roboto Flex Variable, sans-serif",
accent: "Hanken Grotesk, Inter, Roboto Flex Variable, sans-serif",
},
}
},
};

export const dsfrGlobals = {
Expand Down Expand Up @@ -830,7 +835,7 @@ export const dsfrGlobals = {
"white-850": "#F6F8F9D9",
"white-900": "#F6F8F9E5",
"white-950": "#F6F8F9F2",
"white-975": "#F6F8F9F9"
"white-975": "#F6F8F9F9",
},
...commonGlobals,
};
Expand Down
58 changes: 58 additions & 0 deletions e2e/helpers/mount-share-import-modal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { useEffect } from "react";
import { CunninghamProvider } from "../../src/components/Provider/Provider";
import {
ShareImportModal,
ShareImportRow,
} from "../../src/components/share/import-modal/ShareImportModal";

// Playwright CT bridges function props as one-way dispatchers, so tests
// describe scenarios with plain serializable data and this helper — which runs
// in the browser — builds the real callbacks locally. Callback invocations are
// recorded on `window.__shareImportCalls` so tests can assert them via
// `page.evaluate`.

declare global {
interface Window {
__shareImportCalls: { name: string; rows?: ShareImportRow[] }[];
}
}

const useCallRecorder = () => {
useEffect(() => {
window.__shareImportCalls = [];
}, []);
return (name: string, rows?: ShareImportRow[]) =>
window.__shareImportCalls.push({ name, rows });
};

interface TestShareImportModalProps {
title?: string;
description?: string;
maxRows?: number;
/** Registers an onDownloadTemplate handler recorded as "download-template". */
withDownloadTemplate?: boolean;
}

export const TestShareImportModal = ({
title,
description,
maxRows,
withDownloadTemplate,
}: TestShareImportModalProps) => {
const record = useCallRecorder();
return (
<CunninghamProvider currentLocale="en-US">
<ShareImportModal
isOpen={true}
onClose={() => record("close")}
title={title}
description={description}
maxRows={maxRows}
onDownloadTemplate={
withDownloadTemplate ? () => record("download-template") : undefined
}
onImport={(rows) => record("import", rows)}
/>
</CunninghamProvider>
);
};
Loading
Loading