@@ -224,6 +224,62 @@ test('renders the built DevTools panel shell', async ({ page }) => {
224224 }
225225} )
226226
227+ test ( 'uses localized accessible labels for icon controls' , async ( { page } ) => {
228+ test . skip ( ! existsSync ( panelPath ) , 'Run `pnpm build:chrome` before this E2E test.' )
229+ const server = await serveOutputDir ( )
230+
231+ try {
232+ await mockSystemTheme ( page , 'light' )
233+ await page . addInitScript ( ( ) => {
234+ localStorage . setItem ( 'css-diff-locale' , 'zh_CN' )
235+ localStorage . setItem ( 'css-diff-theme' , 'light' )
236+ } )
237+ await mockExtensionApi ( page )
238+ await page . goto ( server . url )
239+
240+ await expect ( page . getByRole ( 'button' , { name : '切换到深色主题' } ) ) . toBeVisible ( )
241+
242+ await page . getByPlaceholder ( '请输入需要查看的 css 属性' ) . fill ( 'color' )
243+
244+ await expect ( page . getByRole ( 'button' , { name : '清空筛选' } ) ) . toBeVisible ( )
245+ await expect ( page . getByRole ( 'button' , { name : 'Clear filter' } ) ) . toHaveCount ( 0 )
246+ }
247+ finally {
248+ await server . close ( )
249+ }
250+ } )
251+
252+ test ( 'lets the panel shell fit narrow DevTools sidebars' , async ( { page } ) => {
253+ test . skip ( ! existsSync ( panelPath ) , 'Run `pnpm build:chrome` before this E2E test.' )
254+ const server = await serveOutputDir ( )
255+
256+ try {
257+ await page . setViewportSize ( { width : 420 , height : 720 } )
258+ await mockExtensionApi ( page )
259+ await page . goto ( server . url )
260+
261+ const bodyLayout = await page . evaluate ( ( ) => {
262+ const style = window . getComputedStyle ( document . body )
263+
264+ return {
265+ margin : style . margin ,
266+ minWidth : style . minWidth ,
267+ overflowX : style . overflowX ,
268+ documentWidth : document . documentElement . scrollWidth ,
269+ viewportWidth : window . innerWidth ,
270+ }
271+ } )
272+
273+ expect ( bodyLayout . margin ) . toBe ( '0px' )
274+ expect ( bodyLayout . minWidth ) . toBe ( '0px' )
275+ expect ( bodyLayout . overflowX ) . not . toBe ( 'hidden' )
276+ expect ( bodyLayout . documentWidth ) . toBeLessThanOrEqual ( bodyLayout . viewportWidth )
277+ }
278+ finally {
279+ await server . close ( )
280+ }
281+ } )
282+
227283test ( 'follows the system theme until the user toggles manually' , async ( { page } ) => {
228284 test . skip ( ! existsSync ( panelPath ) , 'Run `pnpm build:chrome` before this E2E test.' )
229285 const server = await serveOutputDir ( )
0 commit comments