[BUG] Experimental CT: Svelte named Slots
See original GitHub issueContext:
- Playwright Version: experimental-ct-svelte": 1.23.4
- Operating System: Mac / Linux
- Node.js version: 16.14.2 / 18.5.0
- Browser: All
- Extra: *
Code Snippet
Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:
Reproduction: https://github.com/aMediocreDad/playwright-svelte-slots-repro
import { test, expect } from "@playwright/experimental-ct-svelte";
import Component from "./slot-example.svelte";
test("Named Slots", async ({ mount }) => {
const component = await mount(Component, {
props: {
title: "Named Slots",
},
// This should work
slots: {
text: "Hello World",
},
});
const title = component.locator("h1");
await expect(title).toHaveText("Named Slots");
const text = component.locator("p");
// Yet, this fails
await expect(text).toContainText("Hello World");
});
Describe the bug
While this is experimental the FAQ indicates that you can pass (text) to named slots when mounting the Svelte component.
This seems to be wrong. It would, however, be a desirable feature.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Component composition / Named slots • Svelte Tutorial
In those cases, we can use named slots. In ContactCard.svelte , add a name attribute to each slot: <article class="contact-card"> <h2> <slot name="name"> ......
Read more >Cypress Component Testing
Cypress Component Testing provides a component workbench for you to quickly build and test components from multiple front-end UI libraries — no matter....
Read more >chore: mount should return locator pointing to the component ...
chore: mount should return locator pointing to the component element / fragment (#12718. An error occurred. ) ; packages/playwright-ct-react/package.json · @ -1,7 ...
Read more >dvg - River Thames Conditions - Environment Agency - GOV.UK
Letkol bonar panjaitan, Turkey vulture scientific name, Adventure inc tv wiki, ... Scottsdale arrests mugshots, Jwulink library, Lord of ocean slot online, ...
Read more >Untitled
Fernando villaverde sporting, Attribute name xsl, Francisco javier ahedo infante, Park avenue 580 piso 15 b, Every cell contains a number of, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No, I have not tried using those solutions. We use the same solutions we do for Storybook, which is using a svelte component that wraps the one being tested populating the slot with relevant parameters exposed through props.
@bhvngt lets track that in: https://github.com/microsoft/playwright/issues/15900