-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28896 from VickyStash/ts-migration/e2e-lib
[No QA] [TS migration] Migrate 'E2E' lib to TypeScript
- Loading branch information
Showing
38 changed files
with
321 additions
and
121 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 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 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 |
---|---|---|
|
@@ -8,18 +8,16 @@ import ONYXKEYS from '@src/ONYXKEYS'; | |
* If the user is already logged in the function will simply | ||
* resolve. | ||
* | ||
* @param {String} email | ||
* @param {String} password | ||
* @return {Promise<boolean>} Resolved true when the user was actually signed in. Returns false if the user was already logged in. | ||
* @return Resolved true when the user was actually signed in. Returns false if the user was already logged in. | ||
*/ | ||
export default function (email = '[email protected]', password = 'Password123') { | ||
const waitForBeginSignInToFinish = () => | ||
export default function (email = '[email protected]', password = 'Password123'): Promise<boolean> { | ||
const waitForBeginSignInToFinish = (): Promise<void> => | ||
new Promise((resolve) => { | ||
const id = Onyx.connect({ | ||
key: ONYXKEYS.CREDENTIALS, | ||
callback: (credentials) => { | ||
// beginSignUp writes to credentials.login once the API call is complete | ||
if (!credentials.login) { | ||
if (!credentials?.login) { | ||
return; | ||
} | ||
|
||
|
@@ -36,7 +34,7 @@ export default function (email = '[email protected]', password = 'Password123') { | |
const connectionId = Onyx.connect({ | ||
key: ONYXKEYS.SESSION, | ||
callback: (session) => { | ||
if (session.authToken == null || session.authToken.length === 0) { | ||
if (session?.authToken == null || session.authToken.length === 0) { | ||
neededLogin = true; | ||
|
||
// authenticate with a predefined user | ||
|
2 changes: 1 addition & 1 deletion
2
src/libs/E2E/actions/waitForKeyboard.js → src/libs/E2E/actions/waitForKeyboard.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
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,11 @@ | ||
import Response from '@src/types/onyx/Response'; | ||
|
||
const authenticatePusher = (): Response => ({ | ||
auth: 'auth', | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
shared_secret: 'secret', | ||
jsonCode: 200, | ||
requestID: '783ef7fc3991969a-SJC', | ||
}); | ||
|
||
export default authenticatePusher; |
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.