@@ -283,6 +283,7 @@ const run = async () => {
283283 await page . goto ( FRONTEND_URL , { waitUntil : 'networkidle2' } )
284284 await page . evaluate ( ( ) => {
285285 localStorage . setItem ( 'token' , 'e2e-token' )
286+ localStorage . setItem ( 'language' , 'zh' )
286287 } )
287288 await page . reload ( { waitUntil : 'networkidle2' } )
288289 await page . waitForSelector ( 'tbody.ant-table-tbody tr[data-row-key="1"]' , { timeout : 30000 } )
@@ -293,6 +294,15 @@ const run = async () => {
293294 'tbody.ant-table-tbody tr[data-row-key="1"] td' ,
294295 ( cells ) => cells . length
295296 )
297+ const desktopNameHeader = await page . evaluate ( ( ) => {
298+ const header = Array . from ( document . querySelectorAll ( 'thead.ant-table-thead th' ) ) . find (
299+ ( cell ) => cell . textContent ?. trim ( ) === '节点名称'
300+ )
301+ return {
302+ text : header ?. textContent ?. trim ( ) || '' ,
303+ width : header ?. getBoundingClientRect ( ) . width || 0 ,
304+ }
305+ } )
296306 const dragHandleScope = await page . evaluate ( ( ) => {
297307 const row = document . querySelector ( 'tbody.ant-table-tbody tr[data-row-key="1"]' )
298308 const libraryHandles = Array . from (
@@ -349,6 +359,10 @@ const run = async () => {
349359 `Unexpected initial node order: ${ JSON . stringify ( orderBefore ) } `
350360 )
351361 assert ( desktopColumnCount === 16 , `Desktop columns changed unexpectedly: ${ desktopColumnCount } ` )
362+ assert (
363+ desktopNameHeader . text === '节点名称' && desktopNameHeader . width >= 100 ,
364+ `Desktop node-name header changed unexpectedly: ${ JSON . stringify ( desktopNameHeader ) } `
365+ )
352366 assert ( dragHandleScope . libraryHandleCount === 20 , `Unexpected drag handle count: ${ JSON . stringify ( dragHandleScope ) } ` )
353367 assert ( dragHandleScope . allLibraryHandlesScoped , `Library drag handles escape the six-dot controls: ${ JSON . stringify ( dragHandleScope ) } ` )
354368 assert ( ! dragHandleScope . rowIsLibraryHandle , `Table row is still a drag handle: ${ JSON . stringify ( dragHandleScope ) } ` )
@@ -400,6 +414,9 @@ const run = async () => {
400414 const handle = document . querySelector ( '[data-testid="node-drag-handle-1"]' )
401415 const body = tableContainer ?. querySelector ( '.ant-table-body' )
402416 const filterChildren = Array . from ( filterControls ?. children || [ ] )
417+ const nameHeader = Array . from (
418+ tableContainer ?. querySelectorAll ( 'thead.ant-table-thead th' ) || [ ]
419+ ) . find ( ( cell ) => cell . textContent ?. trim ( ) === '名称' )
403420
404421 return {
405422 viewportWidth,
@@ -420,6 +437,8 @@ const run = async () => {
420437 ) ,
421438 bodyClientHeight : body ?. clientHeight || 0 ,
422439 bodyScrollHeight : body ?. scrollHeight || 0 ,
440+ nameHeaderText : nameHeader ?. textContent ?. trim ( ) || '' ,
441+ nameHeaderWidth : nameHeader ?. getBoundingClientRect ( ) . width || 0 ,
423442 }
424443 } )
425444
@@ -441,6 +460,10 @@ const run = async () => {
441460 assert ( mobileLayout . rowTouchAction !== 'none' , `Mobile row blocks native scrolling: ${ JSON . stringify ( mobileLayout ) } ` )
442461 assert ( mobileLayout . handleTouchAction === 'none' , `Mobile drag handle does not own touch dragging: ${ JSON . stringify ( mobileLayout ) } ` )
443462 assert ( mobileLayout . handleIsLibraryHandle , `Mobile six-dot control is not the library drag handle: ${ JSON . stringify ( mobileLayout ) } ` )
463+ assert (
464+ mobileLayout . nameHeaderText === '名称' && mobileLayout . nameHeaderWidth <= 116 ,
465+ `Chinese mobile node-name header is not compact: ${ JSON . stringify ( mobileLayout ) } `
466+ )
444467 assert (
445468 mobileLayout . bodyScrollHeight > mobileLayout . bodyClientHeight ,
446469 `Mobile node list is not vertically scrollable: ${ JSON . stringify ( mobileLayout ) } `
@@ -562,6 +585,9 @@ const run = async () => {
562585 const actionButtons = Array . from (
563586 selectionToolbar ?. querySelectorAll ( 'button' ) || [ ]
564587 )
588+ const nameHeader = Array . from (
589+ table ?. querySelectorAll ( 'thead.ant-table-thead th' ) || [ ]
590+ ) . find ( ( cell ) => cell . textContent ?. trim ( ) === 'Name' )
565591 return {
566592 viewportWidth,
567593 documentScrollWidth : document . documentElement . scrollWidth ,
@@ -574,6 +600,8 @@ const run = async () => {
574600 selectionScrollWidth : selectionToolbar ?. scrollWidth || 0 ,
575601 tableInside : rectInside ( table ) ,
576602 tableHeight : table ?. getBoundingClientRect ( ) . height || 0 ,
603+ nameHeaderText : nameHeader ?. textContent ?. trim ( ) || '' ,
604+ nameHeaderWidth : nameHeader ?. getBoundingClientRect ( ) . width || 0 ,
577605 }
578606 } )
579607 assert (
@@ -590,6 +618,10 @@ const run = async () => {
590618 `Compact mobile selection toolbar overflows: ${ JSON . stringify ( compactMobileLayout ) } `
591619 )
592620 assert ( compactMobileLayout . tableInside && compactMobileLayout . tableHeight > 80 , `Compact mobile table is unusable: ${ JSON . stringify ( compactMobileLayout ) } ` )
621+ assert (
622+ compactMobileLayout . nameHeaderText === 'Name' && compactMobileLayout . nameHeaderWidth <= 100 ,
623+ `English compact-mobile node-name header is not compact: ${ JSON . stringify ( compactMobileLayout ) } `
624+ )
593625
594626 await page . evaluate ( ( ) => localStorage . removeItem ( 'token' ) )
595627 await page . reload ( { waitUntil : 'networkidle2' } )
@@ -638,6 +670,7 @@ const run = async () => {
638670 orderAfterDrag,
639671 reorderPayload : stateAfterDrag . lastReorder ,
640672 dragHandleScope,
673+ desktopNameHeader,
641674 mobileLayout,
642675 mobileExpandedControls,
643676 mobileScrollTop,
0 commit comments