Skip to content

Commit 32eae8c

Browse files
committed
Revert "[Svelte] Remove test with intro options because svelte 4 doesn't support it (yet?)"
This reverts commit 882cbee.
1 parent 882cbee commit 32eae8c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Svelte/assets/test/render_controller.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,25 @@ describe('SvelteController', () => {
8585
await waitFor(() => expect(component).toHaveClass('mounted'));
8686
await waitFor(() => expect(component.innerHTML).toContain('<div><div>Hello without props</div></div>'));
8787
});
88+
89+
it('connect with props and intro', async () => {
90+
const container = mountDOM(`
91+
<div data-testid="component" id="container"
92+
data-controller="check svelte"
93+
data-svelte-component-value="SvelteComponent"
94+
data-svelte-props-value="{&quot;name&quot;: &quot;Symfony with transition&quot;}"
95+
data-svelte-intro-value="true" />
96+
`);
97+
98+
const component = getByTestId(container, 'component');
99+
expect(component).not.toHaveClass('connected');
100+
expect(component).not.toHaveClass('mounted');
101+
102+
application = startStimulus();
103+
104+
await waitFor(() => expect(component).toHaveClass('connected'));
105+
await waitFor(() => expect(component).toHaveClass('mounted'));
106+
expect(component.innerHTML).toContain('style="animation:');
107+
await waitFor(() => expect(component.innerHTML.trim()).toContain('<div>Hello Symfony with transition</div>'));
108+
});
88109
});

0 commit comments

Comments
 (0)