mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 17:56:30 -05:00
Add new data property to iframe that indicates if the content is ready.
Some tests fail because the iframe hasn't loaded the inner hedgedoc renderer yet but cypress tries to travel through the dom and verify the render results. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
93d860be71
commit
1fef30bebc
2 changed files with 2 additions and 1 deletions
|
@ -14,7 +14,7 @@ declare namespace Cypress {
|
||||||
|
|
||||||
Cypress.Commands.add('getMarkdownRenderer', () => {
|
Cypress.Commands.add('getMarkdownRenderer', () => {
|
||||||
return cy
|
return cy
|
||||||
.get(`iframe[data-cy="documentIframe"]`)
|
.get(`iframe[data-cy="documentIframe"][data-content-ready="true"]`)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.its('0.contentDocument')
|
.its('0.contentDocument')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
|
|
|
@ -140,6 +140,7 @@ export const RenderIframe: React.FC<RenderIframeProps> = ({
|
||||||
{...(isTestMode() ? {} : { sandbox: 'allow-downloads allow-same-origin allow-scripts allow-popups' })}
|
{...(isTestMode() ? {} : { sandbox: 'allow-downloads allow-same-origin allow-scripts allow-popups' })}
|
||||||
ref={frameReference}
|
ref={frameReference}
|
||||||
className={`border-0 ${frameClasses ?? ''}`}
|
className={`border-0 ${frameClasses ?? ''}`}
|
||||||
|
data-content-ready={rendererReady}
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue