Skip to content

Commit

Permalink
fix: add data-test attribute for descriptions (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjlanzo authored Aug 21, 2023
1 parent 9073c6c commit 58d3566
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/__tests__/__snapshots__/index.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ exports[`HTML Output given anyOf combiner placed next to allOf given allOf mergi
<span data-test=\\"property-type\\">boolean</span>
</div>
</div>
<div style=\\"font-size: 12px\\"><p>Is this account enabled</p></div>
<div data-test=\\"property-description\\" style=\\"font-size: 12px\\"><p>Is this account enabled</p></div>
</div>
</div>
<div data-id=\\"bd5c934660dce\\" data-test=\\"schema-row\\">
Expand Down Expand Up @@ -361,7 +361,7 @@ exports[`HTML Output given complex type that includes array and complex array su
</div>
</div>
</div>
<div style=\\"font-size: 12px\\">
<div data-test=\\"property-description\\" style=\\"font-size: 12px\\">
<p>
This description can be long and should truncate once it reaches the end of the row. If it's not
truncating then theres and issue that needs to be fixed. Help!
Expand Down Expand Up @@ -453,7 +453,7 @@ exports[`HTML Output given oneOf combiner placed next to allOf given allOf mergi
<span data-test=\\"property-type\\">boolean</span>
</div>
</div>
<div style=\\"font-size: 12px\\"><p>Is this account enabled</p></div>
<div data-test=\\"property-description\\" style=\\"font-size: 12px\\"><p>Is this account enabled</p></div>
</div>
</div>
<div data-id=\\"bd5c934660dce\\" data-test=\\"schema-row\\">
Expand Down Expand Up @@ -704,7 +704,9 @@ exports[`HTML Output top level descriptions should render top-level description
<div data-overlay-container=\\"true\\">
<div class=\\"JsonSchemaViewer\\">
<div></div>
<div style=\\"font-size: 12px\\"><p>This is a description that should be rendered</p></div>
<div data-test=\\"property-description\\" style=\\"font-size: 12px\\">
<p>This is a description that should be rendered</p>
</div>
<div data-level=\\"0\\">
<div data-id=\\"862ab7c3a6663\\" data-test=\\"schema-row\\">
<div>
Expand Down
1 change: 1 addition & 0 deletions src/components/shared/Description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const Description: React.FunctionComponent<{ value: unknown }> = ({ value
return (
<Box
as={MarkdownViewer}
data-test="property-description"
markdown={value}
style={{
fontSize: 12,
Expand Down

0 comments on commit 58d3566

Please sign in to comment.