Skip to content

Commit a290b7f

Browse files
fix tests
1 parent 78c5a23 commit a290b7f

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/registry/views/partials/component-parameters.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const componentParameters = ({
4040
name={paramName}
4141
data-parameter={paramName}
4242
value={currentValue}
43-
placeholder={param.example || ''}
43+
placeholder={String(param.example) || ''}
4444
/>
4545
);
4646
case 'boolean': {
@@ -54,7 +54,7 @@ const componentParameters = ({
5454
checked={isChecked}
5555
style="margin: 0;"
5656
/>
57-
<span>Enable {paramName}</span>
57+
<span safe>Enable {paramName}</span>
5858
</label>
5959
);
6060
}
@@ -69,7 +69,7 @@ const componentParameters = ({
6969
placeholder={
7070
typeof param.default !== 'undefined'
7171
? String(param.default)
72-
: param.example || ''
72+
: String(param.example) || ''
7373
}
7474
/>
7575
);
@@ -79,7 +79,9 @@ const componentParameters = ({
7979
return (
8080
<div class="parameter-item">
8181
<div class="parameter-header">
82-
<span class="parameter-name">{paramName}</span>
82+
<span class="parameter-name" safe>
83+
{paramName}
84+
</span>
8385
<span
8486
class={`parameter-type ${
8587
mandatory === 'mandatory' ? 'parameter-required' : ''
@@ -89,7 +91,9 @@ const componentParameters = ({
8991
</span>
9092
</div>
9193
{!!param.description && (
92-
<p class="parameter-description">{param.description}</p>
94+
<p class="parameter-description" safe>
95+
{param.description}
96+
</p>
9397
)}
9498
{param.type !== 'boolean' && !!param.example && (
9599
<p class="parameter-description">
@@ -98,7 +102,7 @@ const componentParameters = ({
98102
)}
99103
{!param.mandatory && !!param.default && (
100104
<p class="parameter-description">
101-
<strong>Default:</strong> {String(param.default)}
105+
<strong>Default:</strong> <span safe>{String(param.default)}</span>
102106
</p>
103107
)}
104108
{renderInput()}

test/acceptance/registry-ui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('registry (ui interface)', () => {
5757

5858
it('should respond with html result', () => {
5959
expect(headers['content-type']).to.equal('text/html; charset=utf-8');
60-
expect(result).to.match(/<!DOCTYPE html><html lang="en">/);
60+
expect(result).to.match(/<!DOCTYPE html><html lang="en" data-theme="dark">/);
6161
});
6262
});
6363

@@ -77,7 +77,7 @@ describe('registry (ui interface)', () => {
7777

7878
it('should respond with html result', () => {
7979
expect(headers['content-type']).to.equal('text/html; charset=utf-8');
80-
expect(result).to.match(/<!DOCTYPE html><html lang="en">/);
80+
expect(result).to.match(/<!DOCTYPE html><html lang="en" data-theme="dark">/);
8181
});
8282
});
8383

@@ -97,7 +97,7 @@ describe('registry (ui interface)', () => {
9797

9898
it('should respond with html result', () => {
9999
expect(headers['content-type']).to.equal('text/html; charset=utf-8');
100-
expect(result).to.match(/<!DOCTYPE html><html lang="en">/);
100+
expect(result).to.match(/<!DOCTYPE html><html lang="en" data-theme="dark">/);
101101
});
102102

103103
it('should include parameter input fields', () => {

0 commit comments

Comments
 (0)