Skip to content
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

Add tests for groups component #1733

Merged
merged 2 commits into from
Dec 19, 2024
Merged

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!

tests/cypress/template/sidebar-groups.cy.js Outdated Show resolved Hide resolved
// 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>
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
10 of 11 checks passed
@UnniKohonen UnniKohonen deleted the issue1728-groups-cypress-tests branch December 19, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Issue/PR closed
Development

Successfully merging this pull request may close these issues.

Groups view cypress tests
2 participants