Sfoglia il codice sorgente

Merge pull request #30715 from overleaf/msm-full-project-search-sp

[web] Enable Full Project Search in SP for new/old editor

GitOrigin-RevId: f569a45fff3b2c716db7acab3aae4ddbf80903c9
Mathias Jakobsen 7 mesi fa
parent
commit
b9acc4f586
2 ha cambiato i file con 22 aggiunte e 1 eliminazioni
  1. 16 0
      server-ce/test/editor.spec.ts
  2. 6 1
      services/web/config/settings.defaults.js

+ 16 - 0
server-ce/test/editor.spec.ts

@@ -310,6 +310,22 @@ describe('editor', function () {
       cy.get('.cm-editor').should('be.visible')
     })
   })
+
+  describe('full project search', function () {
+    it('can search for text in project files', function () {
+      cy.get('button').contains('Search').click({ force: true })
+      cy.findByRole('searchbox', { name: 'Search' })
+        .should('be.visible')
+        .type('Some examples to get started')
+      cy.get('button').contains('Search').click()
+
+      cy.findByRole('listbox').within(() => {
+        cy.findByRole('option', {
+          name: /Some examples to get started/,
+        }).should('be.visible')
+      })
+    })
+  })
 })
 
 function createRandomLetterString() {

+ 6 - 1
services/web/config/settings.defaults.js

@@ -1039,7 +1039,12 @@ module.exports = {
         '../modules/full-project-search/frontend/js/components/full-project-search-button.tsx'
       ),
     ],
-    fullProjectSearchPanel: [],
+    fullProjectSearchPanel: [
+      Path.resolve(
+        __dirname,
+        '../modules/full-project-search/frontend/js/components/full-project-search.tsx'
+      ),
+    ],
     integrationPanelComponents: [],
     referenceSearchSetting: [],
     errorLogsComponents: [],