diff --git a/apps/pxweb2/src/app/app.tsx b/apps/pxweb2/src/app/app.tsx index 77365348..7abd7745 100644 --- a/apps/pxweb2/src/app/app.tsx +++ b/apps/pxweb2/src/app/app.tsx @@ -9,7 +9,10 @@ export function App() { return (
- +
); } diff --git a/libs/pxweb2-ui/src/lib/pxweb2-ui.stories.tsx b/libs/pxweb2-ui/src/lib/pxweb2-ui.stories.tsx index 84529379..6d63bf82 100644 --- a/libs/pxweb2-ui/src/lib/pxweb2-ui.stories.tsx +++ b/libs/pxweb2-ui/src/lib/pxweb2-ui.stories.tsx @@ -12,7 +12,21 @@ export default meta; type Story = StoryObj; export const Primary = { - args: {}, + args: { + title: 'pxweb2-ui primary!', + variant: 'primary', + }, +}; + +export const Secondary: Story = { + args: { + title: 'pxweb2-ui secondary!', + variant: 'secondary', + }, + play: async ({ canvasElement }) => { + const canvas = within(canvasElement); + expect(canvas.getByText(/pxweb2-ui secondary!/gi)).toBeTruthy(); + }, }; export const Heading: Story = { diff --git a/libs/pxweb2-ui/src/lib/pxweb2-ui.tsx b/libs/pxweb2-ui/src/lib/pxweb2-ui.tsx index 86b65320..989b6ec5 100644 --- a/libs/pxweb2-ui/src/lib/pxweb2-ui.tsx +++ b/libs/pxweb2-ui/src/lib/pxweb2-ui.tsx @@ -1,12 +1,20 @@ import styles from './pxweb2-ui.module.scss'; /* eslint-disable-next-line */ -export interface Pxweb2UiProps {} +export interface Pxweb2UiProps { + title: string; + variant: 'primary' | 'secondary'; +} export function Pxweb2Ui(props: Pxweb2UiProps) { + const title = props.title || 'Welcome to pxweb2-ui!'; + return (
-

Welcome to Pxweb2Ui! Hei alle sammen

+

{title}

+ {props.variant === 'primary' && ( + + )}
); }