File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
packages/runtime-vapor/__tests__/dom Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,25 @@ describe('api: template', () => {
40
40
expect ( nthChild ( root , 2 ) ) . toBe ( root . childNodes [ 2 ] )
41
41
expect ( next ( b ) ) . toBe ( root . childNodes [ 2 ] )
42
42
} )
43
+
44
+ test ( 'attribute quote omission' , ( ) => {
45
+ {
46
+ const t = template ( '<div id=foo class=bar alt=`<="foo></div>' )
47
+ const root = t ( ) as HTMLElement
48
+
49
+ expect ( root . attributes ) . toHaveLength ( 3 )
50
+ expect ( root . getAttribute ( 'id' ) ) . toBe ( 'foo' )
51
+ expect ( root . getAttribute ( 'class' ) ) . toBe ( 'bar' )
52
+ expect ( root . getAttribute ( 'alt' ) ) . toBe ( '`<="foo' )
53
+ }
54
+
55
+ {
56
+ const t = template ( '<div id="foo>bar"class="has whitespace"></div>' )
57
+ const root = t ( ) as HTMLElement
58
+
59
+ expect ( root . attributes ) . toHaveLength ( 2 )
60
+ expect ( root . getAttribute ( 'id' ) ) . toBe ( 'foo>bar' )
61
+ expect ( root . getAttribute ( 'class' ) ) . toBe ( 'has whitespace' )
62
+ }
63
+ } )
43
64
} )
You can’t perform that action at this time.
0 commit comments