File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,33 @@ describe('web components', () => {
130
130
} ) ;
131
131
assert . equal ( other , 1 ) ;
132
132
} ) ;
133
+
134
+ it ( 'sets complex property after other property' , ( ) => {
135
+ const el = document . createElement ( 'x-dummy-button' ) ;
136
+
137
+ // set simple property first
138
+ el . text = 'click me' ;
139
+
140
+ let clicks = 0 ;
141
+ const onClick = ( ) => clicks ++ ;
142
+ el . onClick = onClick ;
143
+
144
+ assert . equal ( el . text , 'click me' ) ;
145
+ assert . equal ( el . onClick , onClick ) ;
146
+
147
+ root . appendChild ( el ) ;
148
+ assert . equal (
149
+ root . innerHTML ,
150
+ '<x-dummy-button text="click me"><button>click me</button></x-dummy-button>'
151
+ ) ;
152
+
153
+ act ( ( ) => {
154
+ el . querySelector ( 'button' ) . click ( ) ;
155
+ } ) ;
156
+
157
+ assert . equal ( el . onClick , onClick ) ;
158
+ assert . equal ( clicks , 1 ) ;
159
+ } ) ;
133
160
} ) ;
134
161
135
162
function Foo ( { text, children } ) {
@@ -327,8 +354,7 @@ describe('web components', () => {
327
354
328
355
const child = document
329
356
. querySelector ( 'x-adopted-style-sheets' )
330
- . shadowRoot
331
- . querySelector ( '.styled-child' ) ;
357
+ . shadowRoot . querySelector ( '.styled-child' ) ;
332
358
333
359
const style = getComputedStyle ( child ) ;
334
360
assert . equal ( style . color , 'rgb(255, 0, 0)' ) ;
You can’t perform that action at this time.
0 commit comments