Merge pull request #12701 from overleaf/dk-cm6-autocomplete-item-space

[cm6] Add space after item autocomplete

GitOrigin-RevId: 6fff77c0c0563530af981bbac73b1d88e02bb759
This commit is contained in:
Mathias Jakobsen
2023-04-20 11:01:06 +01:00
committed by Copybot
parent 4341abcf64
commit 462837b44d
4 changed files with 50 additions and 28 deletions
@@ -283,4 +283,26 @@ describe('<CodeMirrorEditor/> lists in Rich Text mode', function () {
expect(win.getSelection()?.toString()).to.equal('Two')
})
})
it('uses autocomplete to create an list item', function () {
const content = [
'\\begin{itemize}',
'\\item first',
'',
'\\end{itemize}',
].join('\n')
mountEditor(content)
cy.get('.cm-line')
.eq(2)
.click()
.type('\\ite')
.type('{enter}')
.type('second')
cy.get('.cm-content').should(
'have.text',
['\\begin{itemize}', ' first', ' second', '\\end{itemize}'].join('')
)
})
})