File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
packages/svelte/tests/runtime-runes/samples/custom-element-attributes Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ import { test } from '../../test' ;
2+
3+ export default test ( {
4+ mode : [ 'client' , 'server' ] ,
5+ async test ( { assert, target } ) {
6+ const my_element = /** @type HTMLElement & { object: { test: true }; } */ ( target . querySelector ( 'my-element' ) ) ;
7+ const my_link = /** @type HTMLAnchorElement & { object: { test: true }; } */ ( target . querySelector ( 'a' ) ) ;
8+ assert . equal ( my_element . getAttribute ( 'string' ) , 'test' ) ;
9+ assert . equal ( my_element . hasAttribute ( 'object' ) , false ) ;
10+ assert . deepEqual ( my_element . object , { test : true } ) ;
11+ assert . equal ( my_link . getAttribute ( 'string' ) , 'test' ) ;
12+ assert . equal ( my_link . hasAttribute ( 'object' ) , false ) ;
13+ assert . deepEqual ( my_link . object , { test : true } ) ;
14+ }
15+ } ) ;
Original file line number Diff line number Diff line change 1+ <my-element string ="test" object ={{ test : true }}></my-element >
2+ <a is ="my-link" string ="test" object ={{ test : true }}></a >
You can’t perform that action at this time.
0 commit comments