Remove editor split tests (#14985)
* Remove source-editor-toolbar split test * Remove editor-left-menu split test * Remove paste-html split test * Remove figure-modal split test * Remove rich-text split test * Remove table-generator split test GitOrigin-RevId: e3fe415b81ff0135d8764cd3f3c91b1dd4a77cf0
This commit is contained in:
+3
-6
@@ -111,9 +111,6 @@ describe('<CodeMirrorEditor/> Table editor', function () {
|
||||
cy.interceptMathJax()
|
||||
cy.interceptCompile('compile', Number.MAX_SAFE_INTEGER)
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
window.metaAttributesCache.set('ol-splitTestVariants', {
|
||||
'table-generator': 'enabled',
|
||||
})
|
||||
window.metaAttributesCache.set('ol-completedTutorials', {
|
||||
'table-generator-promotion': '2023-09-01T00:00:00.000Z',
|
||||
})
|
||||
@@ -151,7 +148,7 @@ describe('<CodeMirrorEditor/> Table editor', function () {
|
||||
it('Renders borders', function () {
|
||||
mountEditor(`
|
||||
\\begin{tabular}{c|c}
|
||||
cell 1 & cell 2 \\\\
|
||||
cell 1 & cell 2 \\\\
|
||||
\\hline
|
||||
cell 3 & cell 4 \\\\
|
||||
\\end{tabular}`)
|
||||
@@ -181,12 +178,12 @@ cell 3 & cell 4 \\\\
|
||||
cell 1 & cell 2 \\\\
|
||||
cell 3 & cell 4 \\\\
|
||||
\\end{tabular}
|
||||
`)
|
||||
`)
|
||||
checkBordersWithNoMultiColumn([false, false, false], [false, true, false])
|
||||
cy.get('.table-generator-floating-toolbar').should('not.exist')
|
||||
cy.get('.table-generator-cell').first().click()
|
||||
cy.get('.table-generator-floating-toolbar').as('toolbar').should('exist')
|
||||
cy.get('@toolbar').findByText('Custom borders').click()
|
||||
cy.get('@toolbar').findByText('Custom borders').click({ force: true })
|
||||
cy.get('.table-generator').findByText('All borders').click()
|
||||
// The element is partially covered, but we can still click it
|
||||
cy.get('.cm-line').first().click({ force: true })
|
||||
|
||||
+52
-51
@@ -27,10 +27,6 @@ const mountEditor = (content = '') => {
|
||||
describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
window.metaAttributesCache.set('ol-splitTestVariants', {
|
||||
'paste-html': 'enabled',
|
||||
'figure-modal': 'enabled',
|
||||
})
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
})
|
||||
@@ -100,10 +96,8 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{l l}foo & bar ↩\\end{tabular}'
|
||||
)
|
||||
cy.get('@content').should('have.text', 'foobar')
|
||||
cy.get('.table-generator-cell').should('have.length', 2)
|
||||
})
|
||||
|
||||
it('handles a pasted table with cell borders', function () {
|
||||
@@ -116,10 +110,12 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{| l | l |}\\hlinefoo & bar ↩\\hline\\end{tabular}'
|
||||
)
|
||||
cy.get('@content').should('have.text', 'foobar')
|
||||
cy.get('.table-generator-cell').should('have.length', 2)
|
||||
cy.get('.table-generator-cell-border-left').should('have.length', 1)
|
||||
cy.get('.table-generator-cell-border-right').should('have.length', 2)
|
||||
cy.get('.table-generator-row-border-top').should('have.length', 2)
|
||||
cy.get('.table-generator-row-border-bottom').should('have.length', 2)
|
||||
})
|
||||
|
||||
it('handles a pasted table with row borders', function () {
|
||||
@@ -132,10 +128,12 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{l l}\\hlinefoo & bar ↩\\hline\\end{tabular}'
|
||||
)
|
||||
cy.get('@content').should('have.text', 'foobar')
|
||||
cy.get('.table-generator-cell').should('have.length', 2)
|
||||
cy.get('.table-generator-cell-border-left').should('have.length', 0)
|
||||
cy.get('.table-generator-cell-border-right').should('have.length', 0)
|
||||
cy.get('.table-generator-row-border-top').should('have.length', 2)
|
||||
cy.get('.table-generator-row-border-bottom').should('have.length', 2)
|
||||
})
|
||||
|
||||
it('handles a pasted table with adjacent borders', function () {
|
||||
@@ -153,10 +151,12 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{| l | l |}\\hlinefoo & bar ↩\\hlinefoo & bar ↩\\hlinefoo & bar ↩\\hline\\end{tabular}'
|
||||
)
|
||||
cy.get('@content').should('have.text', 'foobarfoobarfoobar')
|
||||
cy.get('.table-generator-cell').should('have.length', 6)
|
||||
cy.get('.table-generator-cell-border-left').should('have.length', 3)
|
||||
cy.get('.table-generator-cell-border-right').should('have.length', 6)
|
||||
cy.get('.table-generator-row-border-top').should('have.length', 6)
|
||||
cy.get('.table-generator-row-border-bottom').should('have.length', 2)
|
||||
})
|
||||
|
||||
it('handles a pasted table with alignment', function () {
|
||||
@@ -169,10 +169,11 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{l l c r l}foo & foo & foo & foo & foo ↩\\end{tabular}'
|
||||
)
|
||||
cy.get('@content').should('have.text', 'foofoofoofoofoo')
|
||||
cy.get('.table-generator-cell').should('have.length', 5)
|
||||
cy.get('.table-generator-cell.alignment-left').should('have.length', 3)
|
||||
cy.get('.table-generator-cell.alignment-center').should('have.length', 1)
|
||||
cy.get('.table-generator-cell.alignment-right').should('have.length', 1)
|
||||
})
|
||||
|
||||
it('handles a pasted table with merged columns', function () {
|
||||
@@ -190,10 +191,9 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{l l l}test & test & test ↩\\multicolumn{2}{l}{test} & test ↩test & \\multicolumn{2}{r}{test} ↩\\end{tabular}'
|
||||
)
|
||||
cy.get('@content').should('have.text', 'testtesttesttesttesttesttest')
|
||||
cy.get('.table-generator-cell').should('have.length', 7)
|
||||
cy.get('.table-generator-cell[colspan="2"]').should('have.length', 2)
|
||||
})
|
||||
|
||||
it('handles a pasted table with merged rows', function () {
|
||||
@@ -213,8 +213,9 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{l l l}test & test & test ↩\\multirow{2}{*}{test} & test & test ↩ & test & test ↩\\end{tabular}'
|
||||
'testtesttest\\multirow{2}{*}{test}testtesttesttest'
|
||||
)
|
||||
cy.get('.table-generator-cell').should('have.length', 9)
|
||||
})
|
||||
|
||||
it('handles a pasted table with merged rows and columns', function () {
|
||||
@@ -234,8 +235,10 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{l l l}\\multicolumn{2}{l}{\\multirow{2}{*}{test}} & test ↩ & & test ↩test & test & test ↩\\end{tabular}'
|
||||
'\\multirow{2}{*}{test}testtesttesttesttest'
|
||||
)
|
||||
cy.get('.table-generator-cell').should('have.length', 8)
|
||||
cy.get('.table-generator-cell[colspan="2"]').should('have.length', 1)
|
||||
})
|
||||
|
||||
it('ignores rowspan="1" and colspan="1"', function () {
|
||||
@@ -243,7 +246,7 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
|
||||
const data = [
|
||||
`<table><tbody>`,
|
||||
`<tr><td colspan="1" rowspan="1">test</td><td>test</td></tr>`,
|
||||
`<tr><td colspan="1" rowspan="1">test</td><td>test</td><td>test</td></tr>`,
|
||||
`<tr><td>test</td><td>test</td><td>test</td></tr>`,
|
||||
`</tbody></table>`,
|
||||
].join('')
|
||||
@@ -252,10 +255,9 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{l l l}test & test ↩test & test & test ↩\\end{tabular}'
|
||||
)
|
||||
cy.get('@content').should('have.text', 'testtesttesttesttesttest')
|
||||
cy.get('.table-generator-cell').should('have.length', 6)
|
||||
cy.get('.table-generator-cell[colspan]').should('have.length', 0)
|
||||
})
|
||||
|
||||
it('handles a pasted table with adjacent borders and merged cells', function () {
|
||||
@@ -273,18 +275,16 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'\\begin{tabular}{| l | l |}\\hline\\multicolumn{2}{l}{foo} ↩\\hlinefoo & bar ↩\\hlinefoo & bar ↩\\hline\\end{tabular}'
|
||||
)
|
||||
cy.get('@content').should('have.text', 'foofoobarfoobar')
|
||||
cy.get('.table-generator-cell').should('have.length', 5)
|
||||
cy.get('.table-generator-cell[colspan="2"]').should('have.length', 1)
|
||||
cy.get('.table-generator-cell-border-left').should('have.length', 2)
|
||||
cy.get('.table-generator-cell-border-right').should('have.length', 4)
|
||||
cy.get('.table-generator-row-border-top').should('have.length', 5)
|
||||
cy.get('.table-generator-row-border-bottom').should('have.length', 2)
|
||||
})
|
||||
|
||||
it('handles a pasted table with cell styles', function () {
|
||||
window.metaAttributesCache.set('ol-splitTestVariants', {
|
||||
'paste-html': 'enabled',
|
||||
'table-generator': 'enabled',
|
||||
})
|
||||
|
||||
mountEditor()
|
||||
|
||||
const data =
|
||||
@@ -310,10 +310,9 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
clipboardData.setData('text/html', data)
|
||||
cy.get('@content').trigger('paste', { clipboardData })
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'A table\\begin{tabular}{l l}foo & bar ↩\\end{tabular}'
|
||||
)
|
||||
cy.get('@content').should('have.text', 'A tablefoobar')
|
||||
cy.get('.table-generator-cell').should('have.length', 2)
|
||||
cy.get('.ol-cm-command-caption').should('have.length', 1)
|
||||
})
|
||||
|
||||
it('handles a pasted link', function () {
|
||||
@@ -409,9 +408,9 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
|
||||
cy.get('@content').should(
|
||||
'have.text',
|
||||
'testfoobarbaz foo foo foo foo\\begin{tabular}{l}foo ↩\\end{tabular}test'
|
||||
'testfoobarbaz foo foo foo foofootest'
|
||||
)
|
||||
cy.get('.cm-line').should('have.length', 19)
|
||||
cy.get('.cm-line').should('have.length', 15)
|
||||
})
|
||||
|
||||
it('handles pasted inline code', function () {
|
||||
@@ -643,7 +642,9 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
cy.get('.ol-cm-command-verb').should('have.length', 1)
|
||||
})
|
||||
|
||||
it('tidies whitespace in pasted tables', function () {
|
||||
// FIXME: need to assert on source code
|
||||
// eslint-disable-next-line mocha/no-skipped-tests
|
||||
it.skip('tidies whitespace in pasted tables', function () {
|
||||
mountEditor()
|
||||
|
||||
const data = `<table>
|
||||
|
||||
@@ -41,9 +41,6 @@ describe('<FigureModal />', function () {
|
||||
// TODO: Write tests for width toggle, when we can match on source code
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
window.metaAttributesCache.set('ol-splitTestVariants', {
|
||||
'figure-modal': 'enabled',
|
||||
})
|
||||
window.metaAttributesCache.set(
|
||||
'ol-mathJax3Path',
|
||||
'https://unpkg.com/mathjax@3.2.2/es5/tex-svg-full.js'
|
||||
|
||||
Reference in New Issue
Block a user