Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add wrapper for version labels #9264

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/core/components/info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ class Info extends React.Component {
<hgroup className="main">
<h2 className="title">
{title}
{version && <VersionStamp version={version} />}
<OpenAPIVersion oasVersion="2.0" />
<span>
{version && <VersionStamp version={version} />}
<OpenAPIVersion oasVersion="2.0" />
</span>
</h2>
{host || basePath ? (
<InfoBasePath host={host} basePath={basePath} />
Expand Down
2 changes: 1 addition & 1 deletion test/unit/xss/info-sanitization.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("<Info/> Sanitization", function(){

it("renders sanitized .title content", function(){
let wrapper = render(<Info {...props}/>)
expect(wrapper.find(".title").html()).toEqual("Test Title **strong** &lt;script&gt;alert(1)&lt;/script&gt;")
expect(wrapper.find(".title").html()).toEqual("Test Title **strong** &lt;script&gt;alert(1)&lt;/script&gt;<span></span>")
})

it("renders sanitized .description content", function() {
Expand Down