Add mutation observer to first heading title extraction logic

This detects async changes of the headline (like katex does).

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-07-03 00:26:29 +02:00
parent eb0162bbe3
commit 96cd8fbe81
2 changed files with 29 additions and 12 deletions

View file

@ -76,8 +76,6 @@ describe('Document Title', () => {
it('katex code looks right', () => {
cy.setCodemirrorContent(`# $\\alpha$-foo`)
cy.getIframeBody().find('h1').should('contain', 'α')
//TODO: Remove workaround after https://github.com/hedgedoc/react-client/issues/1816 has been fixed.
cy.get('.cm-editor .cm-content').type('{Enter}{Enter}{Enter}{Enter}{Enter}')
cy.title().should('eq', `α-foo - HedgeDoc @ ${branding.name}`)
})
})