mirror of https://github.com/sveltejs/svelte
parent
8a8b779586
commit
9c1d17e51f
@ -0,0 +1,18 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
test({ assert, target }) {
|
||||
// If we got here, the component mounted without crashing on document.body access.
|
||||
// Verify autofocus is set as a regular attribute.
|
||||
const input = target.children.find(
|
||||
(/** @type {any} */ n) => n.type === 'element' && n.name === 'input'
|
||||
);
|
||||
assert.ok(input, 'input element should exist');
|
||||
assert.equal(
|
||||
input.attributes['autofocus'],
|
||||
'true',
|
||||
'autofocus should be set as a regular attribute'
|
||||
);
|
||||
assert.equal(input.attributes['value'], 'test', 'value should be set as a regular attribute');
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
let input_tag = 'input';
|
||||
</script>
|
||||
|
||||
<svelte:element this={input_tag} autofocus value="test" />
|
||||
Loading…
Reference in new issue