mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-23 16:54:04 +00: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', () => {
|
||||
return cy
|
||||
.get(`iframe[data-cy="documentIframe"]`)
|
||||
.get(`iframe[data-cy="documentIframe"][data-content-ready="true"]`)
|
||||
.should('be.visible')
|
||||
.its('0.contentDocument')
|
||||
.should('exist')
|
||||
|
|
|
@ -140,6 +140,7 @@ export const RenderIframe: React.FC<RenderIframeProps> = ({
|
|||
{...(isTestMode() ? {} : { sandbox: 'allow-downloads allow-same-origin allow-scripts allow-popups' })}
|
||||
ref={frameReference}
|
||||
className={`border-0 ${frameClasses ?? ''}`}
|
||||
data-content-ready={rendererReady}
|
||||
/>
|
||||
</Fragment>
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue