Skip to content

Commit 526ef9d

Browse files
authored
fix(ws): Updates to Table Columns, Expandable Rows, and Theming (#432)
Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> add icon to workspaceKindsColumns interface fix(ws): Update table with expandable variant and fix styles fix secondary border in menu toggle fix menu toggle expanded text color and update icon to use status prop remove unused files add cluster storage description list group Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> Add title and packages revert form label styling, revert homeVol column fix linting fix lint Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> Add PR code suggestions, remove unused interfaces Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> remove unused import Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> fix filterWorkspacesTest Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> fix(ws): apply feedback to fix Cypress tests Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> Update tests, add width to defineDataFields, remove duplicate WorkspaceTableColumnKeys type Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> fix wrapping behavior Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> Replace Th values with mapped instance Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> revert column order Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> remove hardcoded package label instances Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com> delete cursor rule
1 parent 1916b95 commit 526ef9d

File tree

15 files changed

+471
-259
lines changed

15 files changed

+471
-259
lines changed

workspaces/frontend/src/__tests__/cypress/cypress/tests/mocked/workspaces/WorkspaceDetailsActivity.cy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ describe('WorkspaceDetailsActivity Component', () => {
1111

1212
// This tests depends on the mocked workspaces data at home page, needs revisit once workspace data fetched from BE
1313
it('open workspace details, open activity tab, check all fields match', () => {
14-
cy.findAllByTestId('table-body').first().findByTestId('action-column').click();
14+
cy.findAllByTestId('table-body')
15+
.first()
16+
.findByTestId('action-column')
17+
.find('button')
18+
.should('be.visible')
19+
.click();
1520
// Extract first workspace from mock data
1621
cy.wait('@getWorkspaces').then((interception) => {
1722
if (!interception.response || !interception.response.body) {

workspaces/frontend/src/__tests__/cypress/cypress/tests/mocked/workspaces/Workspaces.cy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ describe('Workspaces Component', () => {
119119
});
120120

121121
function openDeleteModal() {
122-
cy.findAllByTestId('table-body').first().findByTestId('action-column').click();
122+
cy.findAllByTestId('table-body')
123+
.first()
124+
.findByTestId('action-column')
125+
.find('button')
126+
.should('be.visible')
127+
.click();
123128
cy.findByTestId('action-delete').click();
124129
cy.findByTestId('delete-modal-input').should('have.value', '');
125130
}

workspaces/frontend/src/__tests__/cypress/cypress/tests/mocked/workspaces/filterWorkspacesTest.cy.ts

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,34 +31,57 @@ describe('Application', () => {
3131

3232
it('filter rows with multiple filters', () => {
3333
home.visit();
34+
// First filter by name
3435
useFilter('name', 'Name', 'My');
35-
useFilter('podConfig', 'Pod Config', 'Tiny');
36-
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1);
36+
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2);
37+
cy.get("[id$='workspaces-table-row-1']").contains('My First Jupyter Notebook');
38+
39+
// Add second filter by image
40+
useFilter('image', 'Image', 'jupyter');
41+
cy.get("[class$='pf-v6-c-toolbar__group']").contains('Name');
42+
cy.get("[class$='pf-v6-c-toolbar__group']").contains('Image');
43+
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2);
3744
cy.get("[id$='workspaces-table-row-1']").contains('My First Jupyter Notebook');
3845
});
3946

4047
it('filter rows with multiple filters and remove one', () => {
4148
home.visit();
49+
// Add name filter
4250
useFilter('name', 'Name', 'My');
43-
useFilter('podConfig', 'Pod Config', 'Tiny');
44-
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1);
51+
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2);
4552
cy.get("[id$='workspaces-table-row-1']").contains('My First Jupyter Notebook');
46-
cy.get("[class$='pf-v6-c-label-group__close']").eq(1).click();
47-
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Pod Config');
53+
54+
// Add image filter
55+
useFilter('image', 'Image', 'jupyter');
56+
cy.get("[class$='pf-v6-c-toolbar__group']").contains('Name');
57+
cy.get("[class$='pf-v6-c-toolbar__group']").contains('Image');
58+
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2);
59+
60+
// Remove one filter (the first one)
61+
cy.get("[class$='pf-v6-c-label-group__close']").first().click();
62+
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Name');
63+
cy.get("[class$='pf-v6-c-toolbar__group']").contains('Image');
4864
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2);
4965
cy.get("[id$='workspaces-table-row-1']").contains('My First Jupyter Notebook');
5066
cy.get("[id$='workspaces-table-row-2']").contains('My Second Jupyter Notebook');
5167
});
5268

5369
it('filter rows with multiple filters and remove all', () => {
5470
home.visit();
71+
// Add name filter
5572
useFilter('name', 'Name', 'My');
56-
useFilter('podConfig', 'Pod Config', 'Tiny');
57-
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 1);
73+
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2);
5874
cy.get("[id$='workspaces-table-row-1']").contains('My First Jupyter Notebook');
75+
76+
// Add image filter
77+
useFilter('image', 'Image', 'jupyter');
78+
cy.get("[class$='pf-v6-c-toolbar__group']").contains('Name');
79+
cy.get("[class$='pf-v6-c-toolbar__group']").contains('Image');
80+
81+
// Clear all filters
5982
cy.get('*').contains('Clear all filters').click();
60-
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Pod Config');
6183
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Name');
84+
cy.get("[class$='pf-v6-c-toolbar__group']").should('not.contain', 'Image');
6285
cy.get("[id$='workspaces-table-content']").find('tr').should('have.length', 2);
6386
});
6487
});

0 commit comments

Comments
 (0)