test: cover select scoped class regression

pull/16821/head
LeeWxx 2 days ago
parent 391983caee
commit 1c2ba62d3c

@ -207,6 +207,27 @@ test('selects an option with an implicit value', () => {
);
});
test('select merges scoped css hash with static class', () => {
const component = (renderer: Renderer) => {
renderer.select(
{ class: 'foo', value: 'foo' },
'svelte-hash',
undefined,
undefined,
undefined,
(renderer) => {
renderer.option({ value: 'foo' }, (renderer) => renderer.push('foo'));
}
);
};
const { head, body } = Renderer.render(component as unknown as Component);
expect(head).toBe('');
expect(body).toBe(
'<!--[--><select class="foo svelte-hash"><option value="foo" selected>foo</option></select><!--]-->'
);
});
describe('async', () => {
beforeAll(() => {
enable_async_mode_flag();

@ -0,0 +1 @@
<select class="foo svelte-18avu97"><option value="foo" selected>foo</option></select>

@ -0,0 +1,9 @@
<select class="foo" value="foo">
<option value="foo">foo</option>
</select>
<style>
select {
color: red;
}
</style>
Loading…
Cancel
Save