-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: improve email testing * chore: make email verification pass * chore: exiting if variable env is not set * fix: env var import? * chore: wip tests * chore: missing some mailslurp env variable * test: almost making test pass * test: fix e2e * fix: e2e test --------- Co-authored-by: Nicolas Burtey <[email protected]>
- Loading branch information
1 parent
7a5a367
commit f167461
Showing
27 changed files
with
276 additions
and
110 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
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 |
---|---|---|
|
@@ -11,8 +11,8 @@ import { View } from "react-native" | |
import validator from "validator" | ||
import { Screen } from "../../components/screen" | ||
import { useAppConfig } from "@app/hooks" | ||
import { testProps } from "@app/utils/testProps" | ||
|
||
const PLACEHOLDER_EMAIL = "[email protected]" | ||
const useStyles = makeStyles(({ colors }) => ({ | ||
screenStyle: { | ||
padding: 20, | ||
|
@@ -47,7 +47,7 @@ const useStyles = makeStyles(({ colors }) => ({ | |
}, | ||
})) | ||
|
||
export const EmailLoginInputScreen: React.FC = () => { | ||
export const EmailLoginInitiateScreen: React.FC = () => { | ||
const styles = useStyles() | ||
const { | ||
appConfig: { | ||
|
@@ -58,7 +58,7 @@ export const EmailLoginInputScreen: React.FC = () => { | |
const urlEmailCodeRequest = `${authUrl}/auth/email/code` | ||
|
||
const navigation = | ||
useNavigation<StackNavigationProp<RootStackParamList, "emailRegistrationInitiate">>() | ||
useNavigation<StackNavigationProp<RootStackParamList, "emailLoginInitiate">>() | ||
|
||
const [emailInput, setEmailInput] = React.useState<string>("") | ||
const [errorMessage, setErrorMessage] = React.useState<string>("") | ||
|
@@ -73,7 +73,7 @@ export const EmailLoginInputScreen: React.FC = () => { | |
|
||
const submit = async () => { | ||
if (!validator.isEmail(emailInput)) { | ||
setErrorMessage(LL.EmailLoginInputScreen.invalidEmail()) | ||
setErrorMessage(LL.EmailLoginInitiateScreen.invalidEmail()) | ||
return | ||
} | ||
|
||
|
@@ -92,7 +92,8 @@ export const EmailLoginInputScreen: React.FC = () => { | |
const emailLoginId = res.data.result | ||
|
||
if (emailLoginId) { | ||
navigation.navigate("emailLoginValidation", { emailLoginId, email: emailInput }) | ||
console.log({ emailLoginId }) | ||
navigation.navigate("emailLoginValidate", { emailLoginId, email: emailInput }) | ||
} else { | ||
console.warn("no flow returned") | ||
} | ||
|
@@ -124,13 +125,14 @@ export const EmailLoginInputScreen: React.FC = () => { | |
> | ||
<View style={styles.viewWrapper}> | ||
<View style={styles.textContainer}> | ||
<Text type={"p1"}>{LL.EmailLoginInputScreen.header()}</Text> | ||
<Text type={"p1"}>{LL.EmailLoginInitiateScreen.header()}</Text> | ||
</View> | ||
|
||
<View style={styles.inputContainer}> | ||
<Input | ||
{...testProps(LL.EmailRegistrationInitiateScreen.placeholder())} | ||
placeholder={LL.EmailRegistrationInitiateScreen.placeholder()} | ||
autoCapitalize="none" | ||
placeholder={PLACEHOLDER_EMAIL} | ||
inputContainerStyle={styles.inputContainerStyle} | ||
renderErrorMessage={false} | ||
textContentType="emailAddress" | ||
|
@@ -148,7 +150,7 @@ export const EmailLoginInputScreen: React.FC = () => { | |
|
||
<View style={styles.buttonsContainer}> | ||
<GaloyPrimaryButton | ||
title={LL.EmailLoginInputScreen.send()} | ||
title={LL.EmailLoginInitiateScreen.send()} | ||
loading={loading} | ||
disabled={!emailInput} | ||
onPress={submit} | ||
|
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.