-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Convert some files to TS * Convert files to TS * Fix build * Convert some tests * Convert files * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * Fix test * Fix parsing * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * Rebuild yarn.lock * Pin firebase-admin, fix tests * WIP * WIP * Make cookies types more generalized * WIP * WIP * Import type from correct file * WIP
- Loading branch information
1 parent
522185a
commit 06ff195
Showing
77 changed files
with
4,569 additions
and
3,923 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export {} | ||
|
||
const { Auth } = jest.requireActual('firebase-admin/auth') | ||
|
||
const firebaseAdminAuthMock: jest.Mocked<typeof Auth> = | ||
jest.createMockFromModule('firebase-admin/auth') | ||
|
||
const auth = { | ||
createCustomToken: jest.fn(async () => null) as jest.Mock, | ||
verifyIdToken: jest.fn(async () => null) as jest.Mock, | ||
} | ||
|
||
firebaseAdminAuthMock.getAuth = jest.fn(() => auth) | ||
|
||
module.exports = firebaseAdminAuthMock |
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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
export {} | ||
|
||
const { FirebaseError } = jest.requireActual('firebase/app') | ||
|
||
const firebaseAppMock = jest.createMockFromModule('firebase/app') | ||
|
||
firebaseAppMock.getApps = jest.fn(() => []) | ||
|
||
module.exports = firebaseAppMock | ||
module.exports = { | ||
...firebaseAppMock, | ||
FirebaseError, | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Different behaviors when the user's auth status is pending | ||
// or mismatches the page requirements. | ||
|
||
enum AuthAction { | ||
RENDER = 'render', | ||
SHOW_LOADER = 'showLoader', | ||
RETURN_NULL = 'returnNull', | ||
REDIRECT_TO_LOGIN = 'redirectToLogin', | ||
REDIRECT_TO_APP = 'redirectToApp', | ||
} | ||
|
||
export default AuthAction |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
export {} | ||
|
||
let config: any | ||
|
||
const mock: any = jest.createMockFromModule('../config') | ||
|
||
mock.setConfig = jest.fn((newConfig) => { | ||
config = newConfig | ||
}) | ||
|
||
mock.getConfig = jest.fn(() => config) | ||
|
||
module.exports = mock |
2 changes: 2 additions & 0 deletions
2
src/__mocks__/useFirebaseUser.js → src/__mocks__/useFirebaseUser.ts
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export {} | ||
|
||
const mockUseFirebaseUser = jest.fn(() => ({ | ||
user: undefined, | ||
claims: {}, | ||
|
5 changes: 4 additions & 1 deletion
5
src/__tests__/AuthAction.test.js → src/__tests__/AuthAction.test.ts
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
3 changes: 2 additions & 1 deletion
3
src/__tests__/authCookies.test.js → src/__tests__/authCookies.test.ts
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
File renamed without changes.
Oops, something went wrong.