Merge pull request #3804 from overleaf/msm-react-publish-button

[ReactNavigationToolbar] Submit button

GitOrigin-RevId: 9b40e09f001b44bd2f5035469f0d0c852fea7199
This commit is contained in:
Timothée Alby
2021-04-20 02:10:19 +00:00
committed by Copybot
parent f7166c5c1b
commit 0ecebefb0c
9 changed files with 173 additions and 64 deletions
@@ -28,6 +28,16 @@ describe('BrandVariationsHandler', function () {
v1: {
url: 'http://overleaf.example.com'
}
},
modules: {
sanitize: {
options: {
allowedTags: ['br', 'strong'],
allowedAttributes: {
strong: ['style']
}
}
}
}
}
this.V1Api = { request: sinon.stub() }
@@ -107,5 +117,25 @@ describe('BrandVariationsHandler', function () {
}
)
})
it("should sanitize 'submit_button_html'", function (done) {
this.mockedBrandVariationDetails.submit_button_html =
'<br class="break"/><strong style="color:#B39500">AGU Journal</strong><iframe>hello</iframe>'
this.V1Api.request.callsArgWith(
1,
null,
{ statusCode: 200 },
this.mockedBrandVariationDetails
)
return this.BrandVariationsHandler.getBrandVariationById(
'12',
(err, brandVariationDetails) => {
expect(brandVariationDetails.submit_button_html).to.equal(
'<br /><strong style="color:#B39500">AGU Journal</strong>hello'
)
return done()
}
)
})
})
})