-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ws) add filter to workspaces table
Signed-off-by: Elay Aharoni (EXT-Nokia) <elay.aharoni.ext@nokia.com>
- Loading branch information
Elay Aharoni (EXT-Nokia)
committed
Dec 19, 2024
1 parent
9cf6a25
commit 7a34836
Showing
9 changed files
with
586 additions
and
394 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...es/frontend/src/__tests__/cypress/cypress/tests/e2e/workspaces/filterWorkspacesTest.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { home } from '~/__tests__/cypress/cypress/pages/home'; | ||
|
||
const useFilter = (filterName: string, searchValue: string) => { | ||
cy.get("[id$='filter-workspaces-dropdown']").click(); | ||
cy.get(`[id$='filter-workspaces-dropdown-${filterName}']`).click(); | ||
cy.get("[id$='filter-workspaces-search-input']").type(searchValue); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").contains(filterName); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").contains(searchValue); | ||
}; | ||
|
||
describe('Application', () => { | ||
it('filter rows with single filter', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get("[id$='workspaces-table-row-2']").contains('My Other Jupyter Notebook'); | ||
}); | ||
|
||
it('filter rows with multiple filters', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
useFilter('Pod Config', 'Small'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
}); | ||
|
||
it('filter rows with multiple filters and remove one', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
useFilter('Pod Config', 'Small'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get("[class$='pf-v6-c-label-group__close']").eq(1).click(); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Pod Config'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get("[id$='workspaces-table-row-2']").contains('My Other Jupyter Notebook'); | ||
}); | ||
|
||
it('filter rows with multiple filters and remove all', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
useFilter('Pod Config', 'Small'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get('*').contains('Clear all filters').click(); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Pod Config'); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Name'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 4); | ||
}); | ||
}); |
52 changes: 52 additions & 0 deletions
52
...frontend/src/__tests__/cypress/cypress/tests/mocked/workspaces/filterWorkspacesTest.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { home } from '~/__tests__/cypress/cypress/pages/home'; | ||
|
||
const useFilter = (filterName: string, searchValue: string) => { | ||
cy.get("[id$='filter-workspaces-dropdown']").click(); | ||
cy.get(`[id$='filter-workspaces-dropdown-${filterName}']`).click(); | ||
cy.get("[id$='filter-workspaces-search-input']").type(searchValue); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").contains(filterName); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").contains(searchValue); | ||
}; | ||
|
||
describe('Application', () => { | ||
it('filter rows with single filter', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get("[id$='workspaces-table-row-2']").contains('My Other Jupyter Notebook'); | ||
}); | ||
|
||
it('filter rows with multiple filters', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
useFilter('Pod Config', 'Small'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
}); | ||
|
||
it('filter rows with multiple filters and remove one', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
useFilter('Pod Config', 'Small'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get("[class$='pf-v6-c-label-group__close']").eq(1).click(); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Pod Config'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get("[id$='workspaces-table-row-2']").contains('My Other Jupyter Notebook'); | ||
}); | ||
|
||
it('filter rows with multiple filters and remove all', () => { | ||
home.visit(); | ||
useFilter('Name', 'My'); | ||
useFilter('Pod Config', 'Small'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1); | ||
cy.get("[id$='workspaces-table-row-1']").contains('My Jupyter Notebook'); | ||
cy.get('*').contains('Clear all filters').click(); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Pod Config'); | ||
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Name'); | ||
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 4); | ||
}); | ||
}); |
166 changes: 0 additions & 166 deletions
166
workspaces/frontend/src/app/Generic components/Filter.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.