fix: test typecheck

fix-interleaving
paoloricciuti 2 weeks ago committed by GitHub
parent 19a971cc1d
commit 90660afc76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -6,13 +6,15 @@ export default test({
const inputs = target.children.filter(utils.filter_elements((n) => n.name === 'input'));
const button = target.children.find(utils.filter_elements((n) => n.name === 'button'));
const select = target.children.find(utils.filter_elements((n) => n.name === 'select'));
const selected_option = select.children.find(
utils.filter_elements((n) => n.name === 'option' && n.attributes['value'] === 'other')
);
assert.equal(inputs.length, 4);
assert.ok(button);
assert.ok(select);
const selected_option = select?.children.find(
utils.filter_elements((n) => n.name === 'option' && n.attributes['value'] === 'other')
);
assert.ok(selected_option);
// Input 1: direct defaultValue attribute
@ -54,8 +56,8 @@ export default test({
'defaultChecked via spread should go through renderer.setAttribute, not element.defaultChecked'
);
assert.equal(select.attributes['defaultValue'], 'default_val');
assert.equal(selected_option.attributes['selected'], '');
assert.equal(select?.attributes['defaultValue'], 'default_val');
assert.equal(selected_option?.attributes['selected'], '');
// --- After update ---
dispatch_event(button, 'click');
@ -81,7 +83,7 @@ export default test({
'updated defaultChecked=false via spread should go through renderer.removeAttribute'
);
assert.equal(select.attributes['defaultValue'], 'new_default');
assert.equal(selected_option.attributes['selected'], undefined);
assert.equal(select?.attributes['defaultValue'], 'new_default');
assert.equal(selected_option?.attributes['selected'], undefined);
}
});

Loading…
Cancel
Save