@@ -20,6 +20,14 @@ describe('InternalSummaryControl', () => {
20
20
expect ( new Control ( ) ) . to . be . instanceOf ( customElements . get ( 'foxy-internal-editable-control' ) ) ;
21
21
} ) ;
22
22
23
+ it ( 'has a reactive property "unsafeHelperText" that defaults to false' , ( ) => {
24
+ expect ( new Control ( ) ) . to . have . property ( 'unsafeHelperText' , false ) ;
25
+ expect ( Control ) . to . have . deep . nested . property ( 'properties.unsafeHelperText' , {
26
+ attribute : 'unsafe-helper-text' ,
27
+ type : Boolean ,
28
+ } ) ;
29
+ } ) ;
30
+
23
31
it ( 'has a reactive property "layout" that defaults to null' , ( ) => {
24
32
expect ( Control ) . to . have . deep . nested . property ( 'properties.layout' , { } ) ;
25
33
expect ( new Control ( ) ) . to . have . property ( 'layout' , null ) ;
@@ -80,6 +88,15 @@ describe('InternalSummaryControl', () => {
80
88
expect ( control . renderRoot ) . to . include . text ( 'Test helper text' ) ;
81
89
} ) ;
82
90
91
+ it ( 'renders unsafe helper text in default layout if "unsafeHelperText" is true' , async ( ) => {
92
+ const control = await fixture < Control > ( html `
93
+ < foxy-internal-summary-control helper-text ="Test <span>unsafe</span> " unsafe-helper-text >
94
+ </ foxy-internal-summary-control >
95
+ ` ) ;
96
+
97
+ expect ( control . renderRoot ) . to . include . html ( 'Test <span>unsafe</span>' ) ;
98
+ } ) ;
99
+
83
100
it ( 'renders default slot in default layout' , async ( ) => {
84
101
const control = await fixture < Control > ( html `
85
102
< foxy-internal-summary-control > </ foxy-internal-summary-control >
@@ -135,6 +152,20 @@ describe('InternalSummaryControl', () => {
135
152
expect ( summary ) . to . include . text ( 'Test helper text' ) ;
136
153
} ) ;
137
154
155
+ it ( 'renders unsafe helper text inside of the details summary in details layout if "unsafeHelperText" is true' , async ( ) => {
156
+ const control = await fixture < Control > ( html `
157
+ < foxy-internal-summary-control
158
+ helper-text ="Test <span>unsafe</span> "
159
+ layout ="details "
160
+ unsafe-helper-text
161
+ >
162
+ </ foxy-internal-summary-control >
163
+ ` ) ;
164
+
165
+ const summary = control . renderRoot . querySelector ( 'summary' ) ;
166
+ expect ( summary ) . to . include . html ( 'Test <span>unsafe</span>' ) ;
167
+ } ) ;
168
+
138
169
it ( 'renders default slot inside of the details content in details layout' , async ( ) => {
139
170
const control = await fixture < Control > ( html `
140
171
< foxy-internal-summary-control layout ="details "> </ foxy-internal-summary-control >
0 commit comments