@@ -190,7 +190,6 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
190190
191191 const colorMixSwatch = stylePropertyTreeElement . valueElement ?. querySelector ( 'devtools-color-mix-swatch' ) ;
192192 assert . exists ( colorMixSwatch ) ;
193- assert . isTrue ( colorMixSwatch . textContent ?. includes ( 'var(--space)' ) ) ;
194193 } ) ;
195194
196195 it ( 'should show color mix swatch when color-mix is used with an known variable in interpolation method even if it is not a valid method' ,
@@ -201,7 +200,6 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
201200
202201 const colorMixSwatch = stylePropertyTreeElement . valueElement ?. querySelector ( 'devtools-color-mix-swatch' ) ;
203202 assert . exists ( colorMixSwatch ) ;
204- assert . isTrue ( colorMixSwatch . textContent ?. includes ( 'var(--garbage-space)' ) ) ;
205203 } ) ;
206204
207205 it ( 'should not show color mix swatch when color-mix is used with an unknown variable in interpolation method' ,
@@ -225,7 +223,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
225223 renderElementIntoDOM ( colorMixSwatch ) ;
226224
227225 assert . isTrue ( addPopoverSpy . calledOnce ) ;
228- assert . strictEqual ( addPopoverSpy . args [ 0 ] [ 0 ] , colorMixSwatch . icon ) ;
226+ assert . strictEqual ( addPopoverSpy . args [ 0 ] [ 0 ] , colorMixSwatch ) ;
229227 assert . strictEqual ( addPopoverSpy . args [ 0 ] [ 1 ] . contents ( ) ?. textContent , '#ff8000' ) ;
230228 } ) ;
231229
@@ -239,7 +237,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
239237 renderElementIntoDOM ( colorMixSwatch ) ;
240238
241239 assert . isTrue ( addPopoverSpy . calledOnce ) ;
242- assert . strictEqual ( addPopoverSpy . args [ 0 ] [ 0 ] , colorMixSwatch . icon ) ;
240+ assert . strictEqual ( addPopoverSpy . args [ 0 ] [ 0 ] , colorMixSwatch ) ;
243241 assert . strictEqual ( addPopoverSpy . args [ 0 ] [ 1 ] . contents ( ) ?. textContent , 'color(srgb 1 0.24 0.17)' ) ;
244242 } ) ;
245243
@@ -248,12 +246,14 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
248246 getTreeElement ( 'color' , 'color-mix(in srgb, color-mix(in oklch, red, green), blue)' ) ;
249247 stylePropertyTreeElement . updateTitle ( ) ;
250248
251- const outerColorMix = stylePropertyTreeElement . valueElement ?. querySelector ( 'devtools-color-mix-swatch' ) ;
249+ assert . exists ( stylePropertyTreeElement . valueElement ) ;
250+
251+ const [ outerColorMix , innerColorMix ] =
252+ Array . from ( stylePropertyTreeElement . valueElement . querySelectorAll ( 'devtools-color-mix-swatch' ) ) ;
252253 assert . exists ( outerColorMix ) ;
254+ assert . exists ( innerColorMix ) ;
253255 const handler = sinon . fake ( ) ;
254256 outerColorMix . addEventListener ( InlineEditor . ColorMixSwatch . Events . COLOR_CHANGED , handler ) ;
255- const innerColorMix = outerColorMix . querySelector ( 'devtools-color-mix-swatch' ) ;
256- assert . exists ( innerColorMix ) ;
257257 assert . strictEqual ( outerColorMix . getText ( ) , 'color-mix(in srgb, color-mix(in oklch, red, green), blue)' ) ;
258258 assert . strictEqual ( innerColorMix . getText ( ) , 'color-mix(in oklch, red, green)' ) ;
259259 innerColorMix . setFirstColor ( 'blue' ) ;
@@ -262,7 +262,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
262262
263263 // setFirstColor does not actually update the rendered color swatches or the textContent, which is why the first
264264 // color is still red here.
265- const colorSwatch = innerColorMix . querySelector ( 'devtools-color-swatch' ) ;
265+ const colorSwatch = stylePropertyTreeElement . valueElement . querySelector ( 'devtools-color-swatch' ) ;
266266 assert . isOk ( colorSwatch ) ;
267267 const newColor = colorSwatch . getColor ( ) ?. as ( Common . Color . Format . HEX ) ;
268268 assert . isOk ( newColor ) ;
0 commit comments