-
Notifications
You must be signed in to change notification settings - Fork 891
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ss-use-emulator-firestore
- Loading branch information
Showing
69 changed files
with
674 additions
and
1,322 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"firebase": major | ||
"@firebase/firestore": major | ||
--- | ||
|
||
Removed the undocumented `Firestore.logLevel` property. |
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,6 @@ | ||
--- | ||
"firebase": major | ||
"@firebase/firestore": major | ||
--- | ||
|
||
Removed depreacted `experimentalTabSynchronization` settings. To enable multi-tab sychronization, use `synchronizeTabs` instead. |
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,7 @@ | ||
--- | ||
'firebase': major | ||
'@firebase/firestore': major | ||
'@firebase/firestore-types': major | ||
--- | ||
|
||
Removed the `timestampsInSnapshots` option from `FirestoreSettings`. Now, Firestore always returns `Timestamp` values for all timestamp values. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* @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 { FirebaseApp } from '@firebase/app-types'; | ||
import * as impl from '@firebase/auth-exp/internal'; | ||
import { Config } from '@firebase/auth-types-exp'; | ||
import { expect, use } from 'chai'; | ||
import * as sinon from 'sinon'; | ||
import * as sinonChai from 'sinon-chai'; | ||
import { Auth } from './auth'; | ||
|
||
use(sinonChai); | ||
|
||
// For the most part, the auth methods just call straight through. Some parts | ||
// of the auth compat layer are more complicated: these tests cover those | ||
describe('auth compat', () => { | ||
context('redirect persistence key storage', () => { | ||
let underlyingAuth: impl.AuthImpl; | ||
let app: FirebaseApp; | ||
beforeEach(() => { | ||
app = { options: { apiKey: 'api-key' } } as FirebaseApp; | ||
underlyingAuth = new impl.AuthImpl(app, { | ||
apiKey: 'api-key' | ||
} as Config); | ||
sinon.stub(underlyingAuth, '_initializeWithPersistence'); | ||
}); | ||
|
||
afterEach(() => { | ||
sinon.restore; | ||
}); | ||
|
||
it('saves the persistence into session storage if available', () => { | ||
const authCompat = new Auth(app, underlyingAuth); | ||
if (typeof self !== 'undefined') { | ||
sinon.stub(underlyingAuth, '_getPersistence').returns('TEST'); | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
authCompat.signInWithRedirect(new impl.GoogleAuthProvider('google')); | ||
expect( | ||
sessionStorage.getItem('firebase:persistence:api-key:undefined') | ||
).to.eq('TEST'); | ||
} | ||
}); | ||
|
||
it('pulls the persistence and sets as the main persitsence if set', () => { | ||
if (typeof self !== 'undefined') { | ||
sessionStorage.setItem( | ||
'firebase:persistence:api-key:undefined', | ||
'NONE' | ||
); | ||
new Auth(app, underlyingAuth); | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
expect( | ||
underlyingAuth._initializeWithPersistence | ||
).to.have.been.calledWith( | ||
[ | ||
impl._getInstance(impl.inMemoryPersistence), | ||
impl._getInstance(impl.indexedDBLocalPersistence) | ||
], | ||
impl.browserPopupRedirectResolver | ||
); | ||
} | ||
}); | ||
}); | ||
}); |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.