Skip to content

Commit

Permalink
add broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Jan 16, 2024
1 parent fabcacd commit fab6428
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions packages/next-yak/loaders/__tests__/cssloader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,3 +504,38 @@ const Component2 = styled.div\`
}"
`);
});



it("should support conditional nested expressions", async () => {
expect(
await cssloader.call(
loaderContext,
`
import { styled, keyframes, css } from "next-yak";
const color = "green";
const Component = styled.div\`
background-color: red;
color: white;
\${({ active }) => active ? css\`
background-color: blue;
\` : css\`
background-color: \${color};
\`}
border: 1px solid black;
\${({ active }) => active ? css\`
color: blue;
\` : css\`
color: \${color};
\`}
\`;
`
)
).toMatchInlineSnapshot(`
".Component_0 {
THIS IS BROKEN
}"
`);
});

0 comments on commit fab6428

Please sign in to comment.