Skip to content

Add tests for groups component#1733

Merged
UnniKohonen merged 2 commits intomainfrom
issue1728-groups-cypress-tests
Dec 19, 2024
Merged

Add tests for groups component#1733
UnniKohonen merged 2 commits intomainfrom
issue1728-groups-cypress-tests

Conversation

@UnniKohonen
Copy link
Contributor

Reasons for creating this PR

Groups component does not currently have any Cypress tests, this PR adds them.

Link to relevant issue(s), if any

Description of the changes in this PR

  • Adds cypress tests for current functionality of the groups view

Addresses requirement 6 in #1704

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@UnniKohonen UnniKohonen added this to the 3.0 milestone Dec 19, 2024
@UnniKohonen UnniKohonen self-assigned this Dec 19, 2024
@UnniKohonen UnniKohonen requested a review from joelit December 19, 2024 09:36
Copy link
Contributor

@joelit joelit left a comment

Choose a reason for hiding this comment

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

Just two minor things to tweak and this is good to go!

// Check that children are hidden
cy.get('#groups-list li ul').should('not.exist')
})
it('Loads members on group click', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a redundant test that checks the sub-condition of the previous test. I'd say remove it for better maintainability.

Copy link
Contributor Author

@UnniKohonen UnniKohonen Dec 19, 2024

Choose a reason for hiding this comment

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

In the previous test, we are testing clicks on the triangle button and in this test we are testing clicks on actual group link, so they are testing slightly different things

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, in that case I take back my comment!

Co-authored-by: joelit <joeli.takala@helsinki.fi>
@sonarqubecloud
Copy link

Copy link
Contributor

@joelit joelit left a comment

Choose a reason for hiding this comment

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

LGTM

@UnniKohonen UnniKohonen merged commit 33119f5 into main Dec 19, 2024
@UnniKohonen UnniKohonen deleted the issue1728-groups-cypress-tests branch December 19, 2024 11:01
@osma osma modified the milestones: 3.x, 3.0 Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Groups view cypress tests

3 participants