@@ -15,7 +15,7 @@ function Controls() {
1515
1616describe ( 'Power boundary labels' , ( ) => {
1717 for ( const locale of [ 'en' , 'zh' ] as const ) {
18- it ( `keeps metric selection and the modeled-component note clear (${ locale } )` , ( ) => {
18+ it ( `keeps boundary selection clear (${ locale } )` , ( ) => {
1919 const width = locale === 'en' ? 1280 : 390 ;
2020 cy . viewport ( width , 720 ) ;
2121 cy . mount (
@@ -32,40 +32,32 @@ describe('Power boundary labels', () => {
3232 'All in Measured' ,
3333 ]
3434 : [ 'GPU 实测功耗' , 'GPU 额定功耗(TDP)' , '整体预配功耗' , '整体实测功耗' ] ;
35- cy . get ( '[data-testid="all-in-measured-note"]' ) . should ( 'not.exist' ) ;
3635 cy . get ( '[data-testid="measured-power-basis"]' ) . click ( ) ;
37- cy . get ( '[role=" option" ]' ) . should ( ( $options ) => {
36+ cy . get ( '[data-select- option]' ) . should ( ( $options ) => {
3837 expect ( [ ...$options ] . map ( ( option ) => option . textContent ?. trim ( ) ) ) . to . deep . equal ( labels ) ;
3938 } ) ;
40- cy . get ( '[role=" option" ][data-value="gpu-provisioned"]' ) . click ( ) ;
39+ cy . get ( '[data-select- option][data-value="gpu-provisioned"]' ) . click ( ) ;
4140 cy . get ( '[data-testid="selected-metric"]' ) . should ( 'have.text' , 'y_gpuProvisionedWatts' ) ;
4241 cy . get ( '[data-testid="measured-power-basis"]' ) . click ( ) ;
43- cy . get ( '[role=" option" ][data-value="utility-provisioned"]' ) . click ( ) ;
42+ cy . get ( '[data-select- option][data-value="utility-provisioned"]' ) . click ( ) ;
4443 cy . get ( '[data-testid="selected-metric"]' ) . should ( 'have.text' , 'y_utilityProvisionedWatts' ) ;
4544 cy . get ( '[data-testid="measured-power-basis"]' ) . click ( ) ;
46- cy . get ( '[role=" option" ][data-value="utility-modeled"]' ) . click ( ) ;
47- cy . get ( '[role=" option" ]' ) . should ( 'not.exist' ) ;
45+ cy . get ( '[data-select- option][data-value="utility-modeled"]' ) . click ( ) ;
46+ cy . get ( '[data-select- option]' ) . should ( 'not.exist' ) ;
4847 cy . get ( '[data-testid="selected-metric"]' ) . should ( 'have.text' , 'y_utilityModeledWatts' ) ;
49- cy . get ( '[data-testid="all-in-measured-note"]' )
50- . should ( 'be.visible' )
51- . and (
52- 'contain' ,
53- locale === 'en' ? 'unmeasured components are modeled' : '未实测的组件功耗由模型估算' ,
54- ) ;
5548 cy . get ( '[data-testid="measured-metric-controls"]' ) . should ( ( $controls ) => {
5649 const box = $controls [ 0 ] . getBoundingClientRect ( ) ;
5750 expect ( box . left ) . to . be . at . least ( 0 ) ;
5851 expect ( box . right ) . to . be . at . most ( width ) ;
5952 expect ( $controls [ 0 ] . scrollWidth ) . to . be . at . most ( $controls [ 0 ] . clientWidth ) ;
6053 } ) ;
61- cy . screenshot ( `power-boundary-note -${ locale } ` , { overwrite : true } ) ;
54+ cy . screenshot ( `power-boundary-selected -${ locale } ` , { overwrite : true } ) ;
6255 cy . get ( '[data-testid="measured-power-basis"]' ) . click ( ) ;
63- cy . get ( '[role=" option" ][data-value="gpu-measured"]' ) . click ( ) ;
56+ cy . get ( '[data-select- option][data-value="gpu-measured"]' ) . click ( ) ;
6457 cy . get ( '[data-testid="selected-metric"]' ) . should ( 'have.text' , 'y_measuredAvgPower' ) ;
65- cy . get ( '[data-testid="all-in-measured-note"]' ) . should ( 'not.exist' ) ;
66- // Finish selection assertions before a screenshot can dismiss the open Radix menu.
58+ // Finish selection assertions before a screenshot can dismiss the open menu.
6759 cy . get ( '[data-testid="measured-power-basis"]' ) . click ( ) ;
68- cy . get ( '[role=" option" ]' ) . should ( 'be.visible' ) ;
60+ cy . get ( '[data-select- option]' ) . should ( 'be.visible' ) ;
6961 cy . screenshot ( `power-boundary-options-${ locale } ` , { overwrite : true } ) ;
7062 } ) ;
7163 }
0 commit comments