From fab6428cb16bd1c06c95c7f345783c0e7b9fdaa3 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Tue, 16 Jan 2024 14:03:57 +0100 Subject: [PATCH] add broken test --- .../loaders/__tests__/cssloader.test.ts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/packages/next-yak/loaders/__tests__/cssloader.test.ts b/packages/next-yak/loaders/__tests__/cssloader.test.ts index 00476e27..fd0e6931 100644 --- a/packages/next-yak/loaders/__tests__/cssloader.test.ts +++ b/packages/next-yak/loaders/__tests__/cssloader.test.ts @@ -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 + }" + `); +}); \ No newline at end of file