Updated pasted HTML tests (#14277)

GitOrigin-RevId: 2a3001a23c2cf3cd82d3d2b464b5feb858cd5885
This commit is contained in:
Alf Eaton 2023-08-11 09:50:18 +01:00 committed by Copybot
parent 253f2c53d5
commit 9d390f1ab3

View file

@ -142,7 +142,7 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
cy.spy(clipboardData, 'getData').as('get-data')
cy.get('@content').trigger('paste', { clipboardData })
cy.get('@content').should('have.text', '\\href{https://example.com/}{foo}')
cy.get('@content').should('have.text', '{foo}')
cy.get('.ol-cm-command-href').should('have.length', 1)
})
@ -183,19 +183,18 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
it('handles pasted text with formatting', function () {
mountEditor()
const data = '<b>foo</b><sup>th</sup> <i>bar</i><sub>2</sub>'
const data = '<b>foo</b><sup>th</sup> <i>bar</i><sub>2</sub> baz'
const clipboardData = new DataTransfer()
clipboardData.setData('text/html', data)
cy.spy(clipboardData, 'getData').as('get-data')
cy.get('@content').trigger('paste', { clipboardData })
cy.get('@content').should(
'have.text',
'foo\\textsuperscript{th} bar\\textsubscript{2}'
)
cy.get('@content').should('have.text', 'footh bar2 baz')
cy.get('.ol-cm-command-textbf').should('have.length', 1)
cy.get('.ol-cm-command-textit').should('have.length', 1)
cy.get('.ol-cm-command-textsuperscript').should('have.length', 1)
cy.get('.ol-cm-command-textsubscript').should('have.length', 1)
})
it('protects special characters', function () {