@@ -25,6 +25,7 @@ import { join } from 'path'
2525import React from 'react'
2626import { render , screen , cleanup , fireEvent , act , waitFor } from '@testing-library/react'
2727import { DomPanel } from '@site/panels/DomPanel/DomPanel'
28+ import { LayerTreeNodeContent } from '@site/panels/DomPanel/LayerTreeNodeContent'
2829import { useEditorStore } from '@site/store/store'
2930import { makeSite , makePage , makeNode , makeVC , makeVCNode , makeVCTree } from '../fixtures'
3031
@@ -424,6 +425,32 @@ describe('DomPanel — tree accessibility', () => {
424425 expect ( source ) . toContain ( 'treeDropStyles.dropInvalid' )
425426 } )
426427
428+ it ( 'hidden layer rows render a muted eye-off icon instead of a text badge' , ( ) => {
429+ const { container } = render (
430+ < LayerTreeNodeContent
431+ moduleId = "base.container"
432+ displayName = "Container"
433+ htmlTag = "div"
434+ classSelectorChip = { null }
435+ hasChildren = { false }
436+ expanded = { false }
437+ showIcon = { false }
438+ showTag = { false }
439+ showClasses = { false }
440+ hidden
441+ /> ,
442+ )
443+
444+ const hiddenIndicator = container . querySelector ( '[title="Hidden"]' )
445+ expect ( hiddenIndicator ?. querySelector ( 'svg' ) ) . not . toBeNull ( )
446+ expect ( hiddenIndicator ?. textContent ) . toBe ( '' )
447+
448+ const css = readFileSync ( TREE_NODE_CSS_PATH , 'utf8' )
449+ const hiddenIndicatorBlock = css . match ( / \. h i d d e n I n d i c a t o r \s * \{ [ ^ } ] * \} / s) ?. [ 0 ] ?? ''
450+ expect ( hiddenIndicatorBlock ) . toContain ( 'color: var(--text-muted)' )
451+ expect ( css ) . not . toContain ( '.hiddenBadge' )
452+ } )
453+
427454 it ( 'drag overlay is portaled outside the transformed panel to keep pointer alignment' , ( ) => {
428455 const source = readFileSync ( DOM_PANEL_SOURCE_PATH , 'utf8' )
429456
@@ -661,7 +688,7 @@ describe('DomPanel — tree keyboard navigation', () => {
661688 } ) ) . toBeDefined ( )
662689 } )
663690
664- it ( 'keeps hidden nodes in the tree and marks them with a hidden badge ' , ( ) => {
691+ it ( 'keeps hidden nodes in the tree and marks them with a hidden icon ' , ( ) => {
665692 loadContainerSite ( )
666693 act ( ( ) => {
667694 useEditorStore . getState ( ) . toggleNodeHidden ( 'container-1' )
@@ -670,6 +697,7 @@ describe('DomPanel — tree keyboard navigation', () => {
670697 render ( < DomPanel /> )
671698
672699 expect ( screen . getByRole ( 'treeitem' , { name : / c o n t a i n e r , h i d d e n / i } ) ) . toBeDefined ( )
673- expect ( screen . getByText ( 'hidden' ) ) . toBeDefined ( )
700+ const hiddenIndicator = document . querySelector ( '[title="Hidden"]' )
701+ expect ( hiddenIndicator ?. querySelector ( 'svg' ) ) . not . toBeNull ( )
674702 } )
675703} )
0 commit comments