mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Remove spell check split tests (#21382)
GitOrigin-RevId: 819fc94f55dc1d73e4f58e36dd594a5019c68439
This commit is contained in:
-1
@@ -16,7 +16,6 @@ describe('autocomplete', { scrollBehavior: false }, function () {
|
||||
window.metaAttributesCache.set('ol-showSymbolPalette', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptMetadata()
|
||||
cy.interceptSpelling()
|
||||
})
|
||||
|
||||
it('opens autocomplete on matched text', function () {
|
||||
|
||||
-1
@@ -8,7 +8,6 @@ describe('close brackets', { scrollBehavior: false }, function () {
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
|
||||
const scope = mockScope()
|
||||
|
||||
|
||||
-1
@@ -21,7 +21,6 @@ ${'long line '.repeat(200)}`
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
|
||||
const scope = mockScope(content)
|
||||
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ describe('<FigureModal />', function () {
|
||||
cy.interceptMathJax()
|
||||
cy.interceptEvents()
|
||||
cy.interceptMetadata()
|
||||
cy.interceptSpelling()
|
||||
|
||||
mount()
|
||||
})
|
||||
|
||||
|
||||
-1
@@ -11,7 +11,6 @@ test
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
|
||||
const scope = mockScope(content)
|
||||
|
||||
|
||||
-3
@@ -14,7 +14,6 @@ describe('keyboard shortcuts', { scrollBehavior: false }, function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptMetadata()
|
||||
cy.interceptSpelling()
|
||||
|
||||
const scope = mockScope()
|
||||
|
||||
@@ -127,7 +126,6 @@ describe('emacs keybindings', { scrollBehavior: false }, function () {
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
|
||||
const shortDoc = `
|
||||
\\documentclass{article}
|
||||
@@ -229,7 +227,6 @@ describe('vim keybindings', { scrollBehavior: false }, function () {
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
|
||||
// Make a short doc that will fit entirely into the dom tree, so that
|
||||
// index() corresponds to line number - 1
|
||||
|
||||
-8
@@ -114,14 +114,6 @@ forEach(Object.keys(suggestions)).describe(
|
||||
beforeEach(function () {
|
||||
cy.window().then(win => {
|
||||
win.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
win.metaAttributesCache.set('ol-splitTestVariants', {
|
||||
'spell-check-client': 'enabled',
|
||||
'spell-check-no-server': 'enabled',
|
||||
})
|
||||
win.metaAttributesCache.set('ol-splitTestInfo', {
|
||||
'spell-check-client': { phase: 'release' },
|
||||
'spell-check-no-server': { phase: 'release' },
|
||||
})
|
||||
win.metaAttributesCache.set('ol-learnedWords', ['baz'])
|
||||
win.metaAttributesCache.set(
|
||||
'ol-dictionariesRoot',
|
||||
|
||||
-86
@@ -1,86 +0,0 @@
|
||||
import '../../../helpers/bootstrap-3'
|
||||
import { mockScope } from '../helpers/mock-scope'
|
||||
import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import CodeMirrorEditor from '../../../../../frontend/js/features/source-editor/components/codemirror-editor'
|
||||
import { TestContainer } from '../helpers/test-container'
|
||||
|
||||
describe('Spellchecker', function () {
|
||||
const content = `
|
||||
\\documentclass{}
|
||||
|
||||
\\title{}
|
||||
\\author{}
|
||||
|
||||
\\begin{document}
|
||||
\\maketitle
|
||||
|
||||
\\begin{abstract}
|
||||
\\end{abstract}
|
||||
|
||||
\\section{}
|
||||
|
||||
\\end{document}`
|
||||
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
|
||||
const scope = mockScope(content)
|
||||
|
||||
cy.mount(
|
||||
<TestContainer>
|
||||
<EditorProviders scope={scope}>
|
||||
<CodeMirrorEditor />
|
||||
</EditorProviders>
|
||||
</TestContainer>
|
||||
)
|
||||
|
||||
cy.get('.cm-line').eq(13).as('line')
|
||||
cy.get('@line').click()
|
||||
})
|
||||
|
||||
it('makes initial spellcheck request', function () {
|
||||
cy.intercept('POST', '/spelling/check').as('spellCheckRequest')
|
||||
cy.get('@line').type('wombat')
|
||||
cy.wait('@spellCheckRequest')
|
||||
})
|
||||
|
||||
it('makes only one spellcheck request for multiple typed characters', function () {
|
||||
let spellCheckRequestCount = 0
|
||||
cy.intercept('POST', '/spelling/check', req => {
|
||||
++spellCheckRequestCount
|
||||
if (spellCheckRequestCount > 1) {
|
||||
throw new Error('No more than one request was expected')
|
||||
}
|
||||
req.reply({
|
||||
misspellings: [],
|
||||
})
|
||||
}).as('spellCheckRequest')
|
||||
|
||||
cy.get('@line').type('wombat')
|
||||
cy.wait('@spellCheckRequest')
|
||||
})
|
||||
|
||||
it('shows red underline for misspelled word', function () {
|
||||
cy.intercept('POST', '/spelling/check', {
|
||||
misspellings: [
|
||||
{
|
||||
index: 0,
|
||||
suggestions: [
|
||||
'noncombat',
|
||||
'wombat',
|
||||
'nutmeat',
|
||||
'nitwit',
|
||||
'steamboat',
|
||||
'entombed',
|
||||
'tombed',
|
||||
],
|
||||
},
|
||||
],
|
||||
}).as('spellCheckRequest')
|
||||
|
||||
cy.get('@line').type('notawombat')
|
||||
cy.wait('@spellCheckRequest')
|
||||
cy.get('@line').get('.ol-cm-spelling-error').contains('notawombat')
|
||||
})
|
||||
})
|
||||
+1
-1
@@ -107,7 +107,7 @@ function checkBordersWithNoMultiColumn(
|
||||
describe('<CodeMirrorEditor/> Table editor', function () {
|
||||
beforeEach(function () {
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
|
||||
cy.interceptMathJax()
|
||||
cy.interceptCompile('compile', Number.MAX_SAFE_INTEGER)
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
|
||||
-1
@@ -25,7 +25,6 @@ describe('<CodeMirrorEditor/> command tooltip in Visual mode', function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptMetadata()
|
||||
cy.interceptSpelling()
|
||||
})
|
||||
|
||||
it('shows a tooltip for \\href', function () {
|
||||
|
||||
-1
@@ -24,7 +24,6 @@ describe('<CodeMirrorEditor/> floats', function () {
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
})
|
||||
|
||||
it('decorates a caption', function () {
|
||||
|
||||
-1
@@ -26,7 +26,6 @@ describe('<CodeMirrorEditor/> lists in Rich Text mode', function () {
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
})
|
||||
|
||||
it('creates a nested list inside an unindented list', function () {
|
||||
|
||||
-1
@@ -25,7 +25,6 @@ describe('<CodeMirrorEditor/> paste HTML in Visual mode', function () {
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
})
|
||||
|
||||
it('handles paste', function () {
|
||||
|
||||
-1
@@ -62,7 +62,6 @@ describe('<CodeMirrorEditor/> in Visual mode with read-only permission', functio
|
||||
cy.interceptMathJax()
|
||||
cy.interceptEvents()
|
||||
cy.interceptMetadata()
|
||||
cy.interceptSpelling()
|
||||
})
|
||||
|
||||
it('decorates footnote content', function () {
|
||||
|
||||
-1
@@ -39,7 +39,6 @@ describe('<CodeMirrorEditor/> toolbar in Rich Text mode', function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptMetadata()
|
||||
cy.interceptSpelling()
|
||||
})
|
||||
|
||||
it('should handle Undo and Redo', function () {
|
||||
|
||||
-1
@@ -10,7 +10,6 @@ describe('<CodeMirrorEditor/> tooltips in Visual mode', function () {
|
||||
cy.interceptMathJax()
|
||||
cy.interceptMetadata()
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
|
||||
const scope = mockScope('\n\n\n')
|
||||
scope.editor.showVisual = true
|
||||
|
||||
-1
@@ -14,7 +14,6 @@ describe('<CodeMirrorEditor/> in Visual mode', function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptMetadata()
|
||||
cy.interceptSpelling()
|
||||
cy.interceptMathJax()
|
||||
|
||||
// 3 blank lines
|
||||
|
||||
-1
@@ -12,7 +12,6 @@ describe('<CodeMirrorEditor/>', { scrollBehavior: false }, function () {
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
|
||||
cy.interceptEvents()
|
||||
cy.interceptSpelling()
|
||||
})
|
||||
|
||||
it('deletes selected text on Backspace', function () {
|
||||
|
||||
Reference in New Issue
Block a user