Skip to content

Commit 58d3566

Browse files
authored
fix: add data-test attribute for descriptions (#235)
1 parent 9073c6c commit 58d3566

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/__tests__/__snapshots__/index.spec.tsx.snap

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ exports[`HTML Output given anyOf combiner placed next to allOf given allOf mergi
278278
<span data-test=\\"property-type\\">boolean</span>
279279
</div>
280280
</div>
281-
<div style=\\"font-size: 12px\\"><p>Is this account enabled</p></div>
281+
<div data-test=\\"property-description\\" style=\\"font-size: 12px\\"><p>Is this account enabled</p></div>
282282
</div>
283283
</div>
284284
<div data-id=\\"bd5c934660dce\\" data-test=\\"schema-row\\">
@@ -361,7 +361,7 @@ exports[`HTML Output given complex type that includes array and complex array su
361361
</div>
362362
</div>
363363
</div>
364-
<div style=\\"font-size: 12px\\">
364+
<div data-test=\\"property-description\\" style=\\"font-size: 12px\\">
365365
<p>
366366
This description can be long and should truncate once it reaches the end of the row. If it's not
367367
truncating then theres and issue that needs to be fixed. Help!
@@ -453,7 +453,7 @@ exports[`HTML Output given oneOf combiner placed next to allOf given allOf mergi
453453
<span data-test=\\"property-type\\">boolean</span>
454454
</div>
455455
</div>
456-
<div style=\\"font-size: 12px\\"><p>Is this account enabled</p></div>
456+
<div data-test=\\"property-description\\" style=\\"font-size: 12px\\"><p>Is this account enabled</p></div>
457457
</div>
458458
</div>
459459
<div data-id=\\"bd5c934660dce\\" data-test=\\"schema-row\\">
@@ -704,7 +704,9 @@ exports[`HTML Output top level descriptions should render top-level description
704704
<div data-overlay-container=\\"true\\">
705705
<div class=\\"JsonSchemaViewer\\">
706706
<div></div>
707-
<div style=\\"font-size: 12px\\"><p>This is a description that should be rendered</p></div>
707+
<div data-test=\\"property-description\\" style=\\"font-size: 12px\\">
708+
<p>This is a description that should be rendered</p>
709+
</div>
708710
<div data-level=\\"0\\">
709711
<div data-id=\\"862ab7c3a6663\\" data-test=\\"schema-row\\">
710712
<div>

src/components/shared/Description.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const Description: React.FunctionComponent<{ value: unknown }> = ({ value
1313
return (
1414
<Box
1515
as={MarkdownViewer}
16+
data-test="property-description"
1617
markdown={value}
1718
style={{
1819
fontSize: 12,

0 commit comments

Comments
 (0)