Skip to content

test(site): add e2e tests for user auth #12971

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

Merged
merged 10 commits into from
Apr 16, 2024
Merged

test(site): add e2e tests for user auth #12971

merged 10 commits into from
Apr 16, 2024

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Apr 16, 2024

Related: #12508

This PR adds e2e tests for user authentication config.

@mtojek mtojek self-assigned this Apr 16, 2024
@mtojek mtojek mentioned this pull request Apr 16, 2024
@mtojek mtojek marked this pull request as ready for review April 16, 2024 11:35
@mtojek mtojek requested a review from johnstcn April 16, 2024 11:35
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

Non-blocking: I'm somewhat worried about all of the test logic getting stuffed into verifyConfigFlag. Any other special cases will also need to get stuffed in there.

I wonder if we could instead refactor verifyConfigFlag to accept a function that takes a function as an argument. This function should just run whatever assertions are necessary for the particular config flag.

Then the responsibility for asserting the content of the node moves back up to the test instead of in this function, e.g.

  verifyConfigFlag(page, config, flag, (configOpt) -> { expect(configOpt.locator(`...`)).toBeVisible()  })

and verifyConfigFlag is just concerned with finding the relevant option on the page and passing it to the function.

WDYT?

@mtojek
Copy link
Member Author

mtojek commented Apr 16, 2024

I agree, this is a reasonable idea, although I wouldn't pack refactoring here. I refactor the logic in the follow-up to this PR. Thanks for the review 👍

@mtojek mtojek merged commit b598aef into main Apr 16, 2024
@mtojek mtojek deleted the 12508-user-auth branch April 16, 2024 12:32
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants