Przeglądaj źródła

Updated pasted HTML tests (#14277)

GitOrigin-RevId: 2a3001a23c2cf3cd82d3d2b464b5feb858cd5885
Alf Eaton 3 lat temu
rodzic
commit
9d390f1ab3

+ 5 - 6
services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-paste-html.spec.tsx

@@ -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 () {