-
Notifications
You must be signed in to change notification settings - Fork 877
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more redirect tests so that almost all the main use cases are cov…
…ered (#4597) * Flesh out the redirect tests to cover the main use cases as well as error cases * Formatting, licenses * Linter * PR feedback * Formatting * PR feedback
- Loading branch information
Showing
9 changed files
with
485 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages-exp/auth-exp/test/integration/webdriver/static/anonymous.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* @license | ||
* Copyright 2020 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { signInAnonymously } from '@firebase/auth-exp'; | ||
|
||
export async function anonymousSignIn() { | ||
const userCred = await signInAnonymously(auth); | ||
return userCred; | ||
} |
46 changes: 46 additions & 0 deletions
46
packages-exp/auth-exp/test/integration/webdriver/static/core.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* @license | ||
* Copyright 2020 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
export function reset() { | ||
sessionStorage.clear(); | ||
localStorage.clear(); | ||
const del = indexedDB.deleteDatabase('firebaseLocalStorageDb'); | ||
|
||
return new Promise(resolve => { | ||
del.addEventListener('success', () => resolve()); | ||
del.addEventListener('error', () => resolve()); | ||
del.addEventListener('blocked', () => resolve()); | ||
}); | ||
} | ||
|
||
export function authInit() { | ||
return new Promise(resolve => { | ||
auth.onAuthStateChanged(() => resolve()); | ||
}); | ||
} | ||
|
||
export async function userSnap() { | ||
return auth.currentUser; | ||
} | ||
|
||
export async function authSnap() { | ||
return auth; | ||
} | ||
|
||
export function signOut() { | ||
return auth.signOut(); | ||
} |
Oops, something went wrong.