feat: add wrapper for version labels (#9264)

Refs #9167
This commit is contained in:
Patryk Rosiak
2023-09-28 19:21:03 +02:00
committed by GitHub
parent 5e7bde9b13
commit 1addcfebb5
2 changed files with 5 additions and 3 deletions

View File

@@ -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} />

View File

@@ -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() {