mirror of https://github.com/sveltejs/svelte
parent
0cebd320f4
commit
224092b37b
@ -1,18 +1,16 @@
|
|||||||
import { test } from '../../test';
|
import { test } from '../../test';
|
||||||
|
|
||||||
export default test({
|
export default test({
|
||||||
test({ assert, target }) {
|
test({ assert, target, utils }) {
|
||||||
// If we got here, the component mounted without crashing on document.body access.
|
// If we got here, the component mounted without crashing on document.body access.
|
||||||
// Verify autofocus is set as a regular attribute.
|
// Verify autofocus is set as a regular attribute.
|
||||||
const input = target.children.find(
|
const input = target.children.find(utils.filter_elements((n) => n.name === 'input'));
|
||||||
(/** @type {any} */ n) => n.type === 'element' && n.name === 'input'
|
|
||||||
);
|
|
||||||
assert.ok(input, 'input element should exist');
|
assert.ok(input, 'input element should exist');
|
||||||
assert.equal(
|
assert.equal(
|
||||||
input.attributes['autofocus'],
|
input?.attributes['autofocus'],
|
||||||
'true',
|
'true',
|
||||||
'autofocus should be set as a regular attribute'
|
'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