mirror of https://github.com/sveltejs/svelte
parent
6ce5481b4e
commit
3bf1037afe
@ -1,18 +1,16 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
test({ assert, target }) {
|
||||
test({ assert, target, utils }) {
|
||||
// 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'
|
||||
);
|
||||
const input = target.children.find(utils.filter_elements((n) => n.name === 'input'));
|
||||
assert.ok(input, 'input element should exist');
|
||||
assert.equal(
|
||||
input.attributes['autofocus'],
|
||||
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');
|
||||
assert.equal(input?.attributes['value'], 'test', 'value should be set as a regular attribute');
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in new issue