File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,11 @@ export class UUIBoxElement extends LitElement {
75
75
this . headline !== null
76
76
? ''
77
77
: 'display: none' } >
78
- < h5 id ="headline ">
78
+ < h5
79
+ id ="headline "
80
+ style =${ this . _headlineSlotHasContent || this . headline !== null
81
+ ? ''
82
+ : 'display: none' } >
79
83
${ this . headline }
80
84
< slot name ="headline " @slotchange =${ this . _headlineSlotChanged } > </ slot >
81
85
</ h5 >
Original file line number Diff line number Diff line change @@ -5,8 +5,7 @@ import { UUIBoxElement } from './uui-box.element';
5
5
describe ( 'UUIBox' , ( ) => {
6
6
let element : UUIBoxElement ;
7
7
beforeEach ( async ( ) => {
8
- element = await fixture ( html ` < uui-box >
9
- < div slot ="header "> Header</ div >
8
+ element = await fixture ( html ` < uui-box headline ="headline ">
10
9
Main
11
10
</ uui-box > ` ) ;
12
11
} ) ;
@@ -41,4 +40,18 @@ describe('UUIBox', () => {
41
40
expect ( slot ) . to . exist ;
42
41
} ) ;
43
42
} ) ;
43
+
44
+ describe ( 'UUIBox' , ( ) => {
45
+ let element : UUIBoxElement ;
46
+ beforeEach ( async ( ) => {
47
+ element = await fixture ( html ` < uui-box >
48
+ < div slot ="header "> Something in the header</ div >
49
+ Main
50
+ </ uui-box > ` ) ;
51
+ } ) ;
52
+
53
+ it ( 'passes the a11y audit' , async ( ) => {
54
+ await expect ( element ) . shadowDom . to . be . accessible ( ) ;
55
+ } ) ;
56
+ } ) ;
44
57
} ) ;
You can’t perform that action at this time.
0 commit comments