Pre Release New Changes
This commit is contained in:
@@ -1343,3 +1343,26 @@ page Pricing {
|
||||
|
||||
expect(code).toContain('billingCycle === "annual"');
|
||||
});
|
||||
|
||||
test("style blocks compile with stable page/component/layout metadata", () => {
|
||||
const page = compileWireFile(`page StyledPage {
|
||||
style { .shared { color: red; } }
|
||||
view { <main class="shared">Page</main> }
|
||||
}`);
|
||||
const component = compileWireFile(`component StyledCard {
|
||||
style { .shared { color: blue; } }
|
||||
view { <article class="shared">Card</article> }
|
||||
}`);
|
||||
const layout = compileWireFile(`layout StyledLayout {
|
||||
style { .shared { color: green; } }
|
||||
view { <div class="shared"><slot></slot></div> }
|
||||
}`);
|
||||
|
||||
expect(page).toContain('data-wrnexus-style-kind="page"');
|
||||
expect(component).toContain('data-wrnexus-style-kind="component"');
|
||||
expect(layout).toContain('data-wrnexus-style-kind="layout"');
|
||||
expect(page).toContain("export const __wrnexusStyles");
|
||||
expect(component).toContain("export const __wrnexusStyles");
|
||||
expect(layout).toContain("export const __wrnexusStyles");
|
||||
expect(page).toMatch(/data-wrnexus-style-id="wrn-page-[a-z0-9]+"/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user