From 1c59f89a147005d3e3f8ed30ae453688eb5ae616 Mon Sep 17 00:00:00 2001 From: Amanda Bullington <35536439+albullington@users.noreply.github.com> Date: Thu, 26 Dec 2024 21:35:27 -0800 Subject: [PATCH] Add functionality for advanced iNaturalist mode (#2591) * Add functionality for advanced iNaturalist mode * Fix language settings test by toggling advanced mode on * Fix e2e tests by adding advanced user toggle * Fix more tests in Settings with advanced toggle --- e2e/sharedFlows/switchPowerMode.js | 4 + src/components/Settings/LanguageSetting.tsx | 7 +- src/components/Settings/Settings.js | 157 ++++++++++-------- src/i18n/l10n/en.ftl | 4 +- src/i18n/l10n/en.ftl.json | 4 +- src/i18n/strings.ftl | 4 +- tests/integration/LanguageSettings.test.js | 8 + .../unit/components/Settings/Settings.test.js | 10 ++ 8 files changed, 116 insertions(+), 82 deletions(-) diff --git a/e2e/sharedFlows/switchPowerMode.js b/e2e/sharedFlows/switchPowerMode.js index 6cda003d8..6a07b3a31 100644 --- a/e2e/sharedFlows/switchPowerMode.js +++ b/e2e/sharedFlows/switchPowerMode.js @@ -10,6 +10,10 @@ export default async function switchPowerMode() { const settingsDrawerMenuItem = element( by.id( "settings" ) ); await waitFor( settingsDrawerMenuItem ).toBeVisible().withTimeout( 10000 ); await settingsDrawerMenuItem.tap(); + // Tap the settings radio button for advanced interface mode + const advancedInterfaceRadioButton = element( by.id( "advanced-interface-option" ) ); + await waitFor( advancedInterfaceRadioButton ).toBeVisible().withTimeout( 10000 ); + await advancedInterfaceRadioButton.tap(); // Tap the settings radio button for power user mode const powerUserRadioButton = element( by.id( "all-observation-option" ) ); await waitFor( powerUserRadioButton ).toBeVisible().withTimeout( 10000 ); diff --git a/src/components/Settings/LanguageSetting.tsx b/src/components/Settings/LanguageSetting.tsx index 3e3404166..be91d353b 100644 --- a/src/components/Settings/LanguageSetting.tsx +++ b/src/components/Settings/LanguageSetting.tsx @@ -4,6 +4,7 @@ import { Heading4, PickerSheet } from "components/SharedComponents"; +import { View } from "components/styledComponents"; import _ from "lodash"; import React, { useEffect, useState } from "react"; import changeLanguage from "sharedHelpers/changeLanguage.ts"; @@ -51,8 +52,8 @@ const LanguageSetting = ( { onChange }: Props ) => { } return ( - <> - {t( "APP-LANGUAGE" )} + + {t( "APP-LANGUAGE" )}