@@ -34,6 +34,18 @@ describe('ActionList', () => {
3434 toRender : ( ) => < ActionList /> ,
3535 } )
3636
37+ behavesAsComponent ( {
38+ Component : ActionList . Divider ,
39+ options : { skipAs : true , skipSx : true } ,
40+ toRender : ( ) => < ActionList . Divider /> ,
41+ } )
42+
43+ behavesAsComponent ( {
44+ Component : ActionList . TrailingAction ,
45+ options : { skipAs : true , skipSx : true } ,
46+ toRender : ( ) => < ActionList . TrailingAction label = "Action" > Action</ ActionList . TrailingAction > ,
47+ } )
48+
3749 checkExports ( 'ActionList' , {
3850 default : undefined ,
3951 ActionList,
@@ -144,4 +156,46 @@ describe('ActionList', () => {
144156 )
145157 expect ( HTMLRender ( < Element /> ) . container . querySelector ( 'li[aria-hidden="true"]' ) ) . toHaveClass ( 'test-class-name' )
146158 } )
159+
160+ it ( 'list and its sub-components support classname' , ( ) => {
161+ const { container} = HTMLRender (
162+ < ActionList className = "list" >
163+ < ActionList . Heading as = "h2" className = "heading" >
164+ Heading
165+ </ ActionList . Heading >
166+ < ActionList . Item className = "item" >
167+ Item
168+ < ActionList . TrailingAction label = "action" className = "trailing_action" >
169+ Trailing Action
170+ </ ActionList . TrailingAction >
171+ </ ActionList . Item >
172+ < ActionList . Divider className = "divider" />
173+ < ActionList . LinkItem className = "link" href = "//github.com" title = "anchor" aria-keyshortcuts = "d" >
174+ Link Item
175+ </ ActionList . LinkItem >
176+ < ActionList . Group className = "group" >
177+ < ActionList . GroupHeading as = "h2" className = "group_heading" >
178+ Group Heading
179+ </ ActionList . GroupHeading >
180+ < ActionList . Item className = "item" >
181+ < ActionList . TrailingVisual className = "trailing" > Trailing Visual</ ActionList . TrailingVisual >
182+ < ActionList . LeadingVisual className = "leading" > Leading Visual</ ActionList . LeadingVisual >
183+ < ActionList . Description className = "description" > Description</ ActionList . Description >
184+ </ ActionList . Item >
185+ </ ActionList . Group >
186+ </ ActionList > ,
187+ )
188+
189+ expect ( container . querySelector ( '.list' ) ) . toBeInTheDocument ( )
190+ expect ( container . querySelector ( '.heading' ) ) . toBeInTheDocument ( )
191+ expect ( container . querySelector ( '.item' ) ) . toBeInTheDocument ( )
192+ expect ( container . querySelector ( '.trailing_action' ) ) . toBeInTheDocument ( )
193+ expect ( container . querySelector ( '.divider' ) ) . toBeInTheDocument ( )
194+ expect ( container . querySelector ( '.link' ) ) . toBeInTheDocument ( )
195+ expect ( container . querySelector ( '.group' ) ) . toBeInTheDocument ( )
196+ expect ( container . querySelector ( '.group_heading' ) ) . toBeInTheDocument ( )
197+ expect ( container . querySelector ( '.trailing' ) ) . toBeInTheDocument ( )
198+ expect ( container . querySelector ( '.leading' ) ) . toBeInTheDocument ( )
199+ expect ( container . querySelector ( '.description' ) ) . toBeInTheDocument ( )
200+ } )
147201} )
0 commit comments