From 06a1fc32ec72ca0070a8ffdacdba58b130101535 Mon Sep 17 00:00:00 2001 From: Mathias Jakobsen Date: Tue, 18 Nov 2025 14:32:40 +0000 Subject: [PATCH] Merge pull request #29679 from overleaf/mj-references-server-pro [server-pro] Stop running references in server pro GitOrigin-RevId: 41a9c3ca025bb3b631c3007c88f0fea6efbbe4fb --- server-ce/test/editor.spec.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/server-ce/test/editor.spec.ts b/server-ce/test/editor.spec.ts index 4be41f19ba..23e4f34163 100644 --- a/server-ce/test/editor.spec.ts +++ b/server-ce/test/editor.spec.ts @@ -206,6 +206,38 @@ describe('editor', function () { }) }) + describe('cite key search', function () { + it('can insert citation from cite key', function () { + createNewFile() + cy.get('.cm-line').type('\\cite{{}gre') + cy.findByRole('listbox').within(() => { + cy.findByRole('option').should('contain.text', 'greenwade93').click() + }) + cy.get('.cm-line').should('have.text', '\\cite{greenwade93}') + }) + + it('updates citation search when bib file is changed', function () { + createNewFile() + cy.get('.cm-line').type('\\cite{{}new') + // Wait a reasonable time to ensure the autocomplete would've appeared if there were any matches + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(200) + cy.findByRole('listbox').should('not.exist') + cy.findByRole('treeitem', { name: 'sample.bib' }).click() + cy.get('.cm-line') + .last() + .type( + '\n@article{{}newkey2024,\n author = {{}Doe, John},\n title = {{}A New Article},\n journal = {{}Journal of Testing},\n year = 2024\n}\n' + ) + createNewFile() + cy.get('.cm-line').type('\\cite{{}new') + cy.findByRole('listbox').within(() => { + cy.findByRole('option').should('contain.text', 'newkey2024').click() + }) + cy.get('.cm-line').should('have.text', '\\cite{newkey2024}') + }) + }) + describe('layout selector', function () { it('show editor only and switch between editor and pdf', function () { cy.findByRole('region', { name: 'PDF preview and logs' }).should(