Skip to content

[Auth] Add integration tests (headless & webdriver) for middleware #6161

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 4 commits into from
Apr 15, 2022

Conversation

sam-gc
Copy link
Contributor

@sam-gc sam-gc commented Apr 15, 2022

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Apr 15, 2022

⚠️ No Changeset found

Latest commit: 7f8c8b0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

use(chaiAsPromised);
use(sinonChai);

export function generateMiddlewareTests(authGetter: () => Auth, signIn: () => Promise<unknown>): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jamesdaniels I tried to be exhaustive with these tests. Please take a look and see if I'm missing any big use case.

Cross-tab testing is done down in the webdriver/* files.

I'll add the onAbort callback to the tests once that's merged

@google-oss-bot
Copy link
Contributor

@google-oss-bot
Copy link
Contributor

Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

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

Looks good, seems pretty thorough to me.

@@ -70,6 +75,26 @@ browserDescribe('WebDriver redirect IdP test', driver => {
expect(await driver.call(RedirectFunction.REDIRECT_RESULT)).to.be.null;
});

// Redirect works with middleware for now
xit('is blocked by middleware', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this temporarily being skipped because it's not implemented yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I'll switch it to it once that part is working

@sam-gc
Copy link
Contributor Author

sam-gc commented Apr 15, 2022

I'm gonna go ahead and submit this. @jamesdaniels if you see anything I need to add later give me a heads up after

@sam-gc sam-gc merged commit 4f6ee70 into auth-middleware Apr 15, 2022
@sam-gc sam-gc deleted the sam-gc/middleware-tests branch April 15, 2022 22:14
@jamesdaniels
Copy link
Member

@sam-gc SGTM, I'll do some testing next week.

sam-gc added a commit that referenced this pull request May 4, 2022
…6161)

* Add integration tests for auth middleware

* Webdriver tests

* Lint

* Formatting
@firebase firebase locked and limited conversation to collaborators May 16, 2022
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.

4 participants