Skip to content

Commit

Permalink
Add some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mad-Kat committed Dec 18, 2024
1 parent 3c63847 commit bed2f10
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/next-yak/runtime/__tests__/cssPropTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,36 @@ const ComponentWithDynamicCSSVarsButWithoutOwnProps = () => {
/>
);
};

const ComponentWithDynamicCSSWithOwnPropsShouldGenerateTypeError = () => {
return (
<div
// @ts-expect-error - properties not supported
css={css<{ $primary: boolean }>`
padding: ${({ $primary }) => $primary && "20px"};
`}
/>
);
};

const dynamicMixin = css<{ $primary: boolean }>`
${({ $primary }) =>
$primary &&
css`
font-size: 1.7rem;
`}
`;

const ComponentWithCSSThatUsesDynamicMixinWithOwnPropsShouldGenerateTypeError =
() => {
return (
<div
css={css`
${
// @ts-expect-error - properties not supported
dynamicMixin
}
`}
/>
);
};

0 comments on commit bed2f10

Please sign in to comment.