Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In experimental-ct-svelte, is it possible to pass a component as a prop #19151

Closed
obgibson opened this issue Nov 29, 2022 · 3 comments
Closed

Comments

@obgibson
Copy link

I have a Button component that accepts a prop that is an icon. e.g. <Button leadingIcon={ChevronLeft}/>

I am trying to write a unit test with @playwright/experimental-ct-svelte.

I have not been able to pass a component as a prop.

import { test, expect } from '@playwright/experimental-ct-svelte';
import Icon from '../icons/chevronleft.svelte';
import Button from '../Button.svelte';

const buttonText = 'Click me';

test('Button shows leading icon', async ({ mount }) => {
	const IconComponent = await mount(Icon);
	const component = await mount(Button, {
		props: { leadingIcon: IconComponent },
		slots: { default: buttonText }
	});
	expect(component);
});

Is this possible?

@mxschmitt
Copy link
Member

mxschmitt commented Nov 30, 2022

Marking it as a feature request, its not possible as of today.

@sand4rt
Copy link
Collaborator

sand4rt commented Dec 1, 2022

related to: #15620

@pavelfeldman
Copy link
Member

Why was this issue closed?

Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.

If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants