Skip to content

Add chevron collapsible table #3598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

arbulu89
Copy link
Contributor

Description

Update Table collapsible rows usage to add a chevron to collapse/expand instead of clicking anywhere in the row.
When a table has collapsible rows, the first cell of the row is reserved to add chevron.

collapsible_table

How was this tested?

UT and e2e

@arbulu89 arbulu89 added the enhancement New feature or request label Jun 25, 2025
@arbulu89 arbulu89 requested review from jagabomb and EMaksy June 25, 2025 13:41
@arbulu89 arbulu89 marked this pull request as ready for review June 25, 2025 13:42
Copy link
Member

@EMaksy EMaksy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @arbulu89 great job, it looks good to me only check out my comment about the selectors.

Quick question: why did you go back to using just the chevron? Would it make sense to keep both — the chevron to indicate the table is collapsible, and also keep the row clickable to expand it?
I’m just thinking in terms of usability — making it easier for users to interact with either element but sure @jagabomb had his reasons :D

@@ -117,9 +117,11 @@ export const cleanUpButtonIsNotDisplayed = () => {

// UI Interactions

export const clickHdqDatabaseRow = () => cy.get(hdqDatabaseCell).click();
export const clickHdqDatabaseRow = () =>
cy.get(`${hdqDatabaseCell} > td:eq(0)`).click();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey could we extract this as own selector ?
Someting like this ?

export const hdqDatabaseRowFirstCell = `${hdqDatabaseCell} > td:eq(0)`;
export const hddDatabaseRowFirstCell = `${hddDatabaseCell} > td:eq(0)`;

And put the selectors on top of the file so we have code like this

export const clickHdqDatabaseRow = () => cy.get(hdqDatabaseRowFirstCell).click();

export const clickHddDatabaseRow = () => cy.get(hddDatabaseRowFirstCell).click();

We use this approach through the different page objects.

const hddDatabaseCell = `tr:contains("${hddDatabase.sid}")`;
and
const providerLabel = 'div[class*="text-lg"]:contains("Provider") + div';

Checkout the adr from @vicenteqa https://github.com/trento-project/docs/blob/main/adr/0019-e2e-testing-practices.md#decisions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good idea!
Done!

@jagabomb
Copy link
Contributor

Minor feedback, can we change the padding-left of the arrow/chevron icon to 1em? I think its pl-4 😅. I think it will create a better balance in the row.

@arbulu89
Copy link
Contributor Author

@jagabomb @EMaksy changes done!
About only having the chevron as clickable: I think it is better. Otherwise we need to handle the onClick propagation in other clickable items in the row, which can be problematic.

@arbulu89 arbulu89 requested a review from EMaksy June 26, 2025 15:01
Copy link
Contributor

@jagabomb jagabomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants