Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
added settings testIds
Browse files Browse the repository at this point in the history
  • Loading branch information
ggilchrist-ledger committed Apr 27, 2022
1 parent 77f2366 commit 612eeb8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
13 changes: 7 additions & 6 deletions e2e/models/settings/generalSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import * as testHelpers from "../../helpers";

export default class GeneralSettingsPage {
static async togglePassword() {
await testHelpers.scrollToElementById(
"password-settings-toggle",
"general-settings-scroll-view",
200,
);
// scroll not needed for now
// await testHelpers.scrollToElementById(
// "password-settings-toggle",
// "general-settings-scroll-view",
// 200,
// );

await testHelpers.tap("password-settings-toggle");
}

static async enterNewPassword(passwordText) {
await testHelpers.typeText("password-text-input", passwordText);
await testHelpers.tap("Proceed");
await testHelpers.tap("Confirm");
}

static async isVisible() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/onboarding.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Onboarding", () => {
console.log("==============> STARTING ONBOARDING DEVICE LAUNCH");
// await device.reloadReactNative();
// await device.launchApp({ newInstance: true });
await device.launchApp({ delete: true });
await device.launchApp();
});

it("should be able to connect a Nano X", async () => {
Expand Down
2 changes: 0 additions & 2 deletions e2e/specs/password.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ const CORRECT_PASSWORD = "passWORD$123!";
describe("Password Lock Screen", () => {
beforeAll(async () => {
console.log("==============> STARTING PASSWORD DEVICE LAUNCH");
// await device.launchApp({ newInstance: false });
// await device.reloadReactNative();
console.log("==============> LAUNCH APP BEFORE ALL");
await device.launchApp({ delete: true });
});

Expand Down
4 changes: 3 additions & 1 deletion src/components/SettingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type Props = {
Icon: IconType;
onClick: Function;
arrowRight?: boolean;
settingsCardTestId?: string;
};

function Card({
Expand Down Expand Up @@ -48,6 +49,7 @@ export default function SettingsCard({
Icon,
onClick,
arrowRight,
settingsCardTestId,
}: Props) {
return (
<StyledCard onPress={onClick}>
Expand All @@ -59,7 +61,7 @@ export default function SettingsCard({
borderColor={"primary.c80"}
iconColor={"primary.c80"}
/>
<Box ml={6} flex={1}>
<Box ml={6} flex={1} testID={settingsCardTestId}>
<Text variant={"large"} fontWeight={"semiBold"} color={"neutral.c100"}>
{title}
</Text>
Expand Down
6 changes: 5 additions & 1 deletion src/screens/Settings/General/AuthSecurityToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ export default function AuthSecurityToggle() {
title={t("settings.display.password")}
desc={t("settings.display.passwordDesc")}
>
<Switch checked={!!privacy} onChange={onValueChange} />
<Switch
checked={!!privacy}
onChange={onValueChange}
testID="password-settings-toggle"
/>
</SettingsRow>
{privacy ? <BiometricsRow /> : null}
</>
Expand Down
1 change: 1 addition & 0 deletions src/screens/Settings/General/PasswordForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class PasswordForm extends PureComponent<Props, State> {
secureTextEntry={secureTextEntry}
placeholder={placeholder}
password={value}
testID="password-text-input"
/>
</View>
{error && (
Expand Down
1 change: 1 addition & 0 deletions src/screens/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default function Settings({ navigation }: Props) {
Icon={Icons.MobileMedium}
onClick={() => navigation.navigate(ScreenName.GeneralSettings)}
arrowRight
settingsCardTestId="general-settings-card"
/>
{accounts.length > 0 && (
<SettingsCard
Expand Down

0 comments on commit 612eeb8

Please sign in to comment.