diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-06-27 00:00:53 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-06-27 12:13:14 +0200 |
commit | 362c6238fcadb74c54c2a8c7b2c12c5a1011c0b5 (patch) | |
tree | 788796ae091291c2753905616f6a6db3aaa02464 /cypress/e2e | |
parent | dd3dcf37039ed969b1a2f6b89941a65ccf73b696 (diff) | |
download | nextcloud-server-362c6238fcadb74c54c2a8c7b2c12c5a1011c0b5.tar.gz nextcloud-server-362c6238fcadb74c54c2a8c7b2c12c5a1011c0b5.zip |
fix: Allow to reset unified search using the `nextcloud:unified-search:reset` event
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress/e2e')
-rw-r--r-- | cypress/e2e/files/files-searching.cy.ts | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/cypress/e2e/files/files-searching.cy.ts b/cypress/e2e/files/files-searching.cy.ts index 5f81057000d..10ca1b44e2f 100644 --- a/cypress/e2e/files/files-searching.cy.ts +++ b/cypress/e2e/files/files-searching.cy.ts @@ -5,9 +5,10 @@ import type { User } from '@nextcloud/cypress' import { getRowForFile, navigateToFolder } from './FilesUtils' -import { UnifiedSearchFilter, getUnifiedSearchFilter, getUnifiedSearchInput, getUnifiedSearchModal, openUnifiedSearch } from '../core-utils.ts' +import { UnifiedSearchPage } from '../../pages/UnifiedSearch.ts' describe('files: Search and filter in files list', { testIsolation: true }, () => { + const unifiedSearch = new UnifiedSearchPage() let user: User beforeEach(() => cy.createRandomUser().then(($user) => { @@ -20,17 +21,21 @@ describe('files: Search and filter in files list', { testIsolation: true }, () = cy.visit('/apps/files') })) + it('files app supports local search', () => { + unifiedSearch.openLocalSearch() + unifiedSearch.localSearchInput() + .should('not.have.css', 'display', 'none') + .and('not.be.disabled') + }) + it('filters current view', () => { // All are visible by default getRowForFile('a folder').should('be.visible') getRowForFile('b file').should('be.visible') // Set up a search query - openUnifiedSearch() - getUnifiedSearchInput().type('a folder') - getUnifiedSearchFilter(UnifiedSearchFilter.FilterCurrentView).click({ force: true }) - // Wait for modal to close - getUnifiedSearchModal().should('not.be.visible') + unifiedSearch.openLocalSearch() + unifiedSearch.typeLocalSearch('a folder') // See that only the folder is visible getRowForFile('a folder').should('be.visible') @@ -43,11 +48,8 @@ describe('files: Search and filter in files list', { testIsolation: true }, () = getRowForFile('b file').should('be.visible') // Set up a search query - openUnifiedSearch() - getUnifiedSearchInput().type('a folder') - getUnifiedSearchFilter(UnifiedSearchFilter.FilterCurrentView).click({ force: true }) - // Wait for modal to close - getUnifiedSearchModal().should('not.be.visible') + unifiedSearch.openLocalSearch() + unifiedSearch.typeLocalSearch('a folder') // See that only the folder is visible getRowForFile('a folder').should('be.visible') @@ -66,11 +68,8 @@ describe('files: Search and filter in files list', { testIsolation: true }, () = getRowForFile('b file').should('be.visible') // Set up a search query - openUnifiedSearch() - getUnifiedSearchInput().type('a folder') - getUnifiedSearchFilter(UnifiedSearchFilter.FilterCurrentView).click({ force: true }) - // Wait for modal to close - getUnifiedSearchModal().should('not.be.visible') + unifiedSearch.openLocalSearch() + unifiedSearch.typeLocalSearch('a folder') // See that only the folder is visible getRowForFile('a folder').should('be.visible') @@ -84,5 +83,8 @@ describe('files: Search and filter in files list', { testIsolation: true }, () = // see that the folder is not filtered getRowForFile('a folder').should('be.visible') getRowForFile('b file').should('be.visible') + + // see the filter bar is gone + unifiedSearch.localSearchInput().should('not.exist') }) }) |