diff --git a/core/components/RecoSlider.tsx b/core/components/RecoSlider.tsx index 30f23b5275e60bd07fd4a62ecb576a7be5334f75..595c8657fd42f22b70698e5b2ed0b31f8c17e8b7 100644 --- a/core/components/RecoSlider.tsx +++ b/core/components/RecoSlider.tsx @@ -127,7 +127,11 @@ const RecoSlider: React.FC<RecoSliderProps> = ({ </Text> </View> </View> - {seeAllPath && <TextLink size="sm">{t('global.seeAll')}</TextLink>} + {seeAllPath && ( + <TextLink size="sm" role="none"> + {t('global.seeAll')} + </TextLink> + )} </View> </HoliButton> diff --git a/core/navigation/components/HoliTextLink/index.web.tsx b/core/navigation/components/HoliTextLink/index.web.tsx index 540b75a9e61424a945fc6fdc0ec7b5d065e8bd36..3b35e18faba05d224c8a11475aae5dfd3a7a81cb 100644 --- a/core/navigation/components/HoliTextLink/index.web.tsx +++ b/core/navigation/components/HoliTextLink/index.web.tsx @@ -3,7 +3,7 @@ import type { PropsWithChildren } from 'react' import React from 'react' import { HoliLink } from '@holi/core/navigation/components/HoliLink' -import { HoliTextLinkProps } from '@holi/core/navigation/components/HoliTextLink/types' +import type { HoliTextLinkProps } from '@holi/core/navigation/components/HoliTextLink/types' export const HoliTextLink = ({ href, @@ -17,7 +17,7 @@ export const HoliTextLink = ({ size, }: PropsWithChildren<HoliTextLinkProps>) => { return ( - <TextLink size={size} variant={variant} textAlign={textAlign}> + <TextLink size={size} variant={variant} textAlign={textAlign} role="none"> <HoliLink href={href} label={label} diff --git a/core/screens/act/ActHome.tsx b/core/screens/act/ActHome.tsx index 0c8079700579365bceb4099e757f459607b16b4e..e3714168b8b7e0fc8e2e2967a44f5fdec8cf377c 100644 --- a/core/screens/act/ActHome.tsx +++ b/core/screens/act/ActHome.tsx @@ -65,7 +65,7 @@ const ActHome = () => { return ( <ScrollViewRefreshable style={styles.layout}> - <View style={styles.container}> + <View style={styles.container} testID="act-home"> <AttendingChallengeEventsLegacy /> {sections.map((sectionName) => ( <ActSection type={sectionName} key={sectionName} /> diff --git a/core/screens/onboarding/helpers/__tests__/getRouteForContentType.test.ts b/core/screens/onboarding/helpers/__tests__/getRouteForContentType.test.ts index a142fa25a9797bc5f5870401263ff62f88594108..86e92d413f62cc53b46ae470e14cd32f98fe0c4c 100644 --- a/core/screens/onboarding/helpers/__tests__/getRouteForContentType.test.ts +++ b/core/screens/onboarding/helpers/__tests__/getRouteForContentType.test.ts @@ -7,12 +7,13 @@ describe('getRouteForContentType', () => { { contentType: 'VOLUNTEERING', expectedRoute: '/act?section=VOLUNTEERING' }, { contentType: 'SPACES', expectedRoute: '/spaces?tab=discover' }, { contentType: 'POSTS', expectedRoute: '/' }, - { contentType: 'invalid', expectedRoute: '/' }, + { contentType: 'invalid', expectedRoute: '/act' }, + { contentType: null, expectedRoute: '/act' }, ] it.each(testCases)( 'should create route $expectedRoute for content type $contentType', async ({ contentType, expectedRoute }) => { - const route = getRouteForContentType(contentType as ContentValue) + const route = getRouteForContentType(contentType as ContentValue | null) expect(route).toEqual(expectedRoute) } diff --git a/core/screens/onboarding/helpers/getRouteForContentType.ts b/core/screens/onboarding/helpers/getRouteForContentType.ts index 91b6aff48bbd8b9e2d333ce9d26ef3d5e457c59d..8faebbf0b5e46df215d33a2ebdb0f1e34924bdfa 100644 --- a/core/screens/onboarding/helpers/getRouteForContentType.ts +++ b/core/screens/onboarding/helpers/getRouteForContentType.ts @@ -10,7 +10,8 @@ export const getRouteForContentType = (selectedContentType?: ContentValue | null case 'SPACES': return '/spaces?tab=discover' case 'POSTS': - default: return '/' + default: + return '/act' } } diff --git a/e2e/mobile/helpers/auth.ts b/e2e/mobile/helpers/auth.ts index 29561ea9e44fbc6884c09cfb6419b663411851f4..49478e0f179443b82aa3827a3c526e601249640a 100644 --- a/e2e/mobile/helpers/auth.ts +++ b/e2e/mobile/helpers/auth.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker' -import { navigateBackToHomeScreen, waitForHomeScreen } from '../helpers/navigation' +import { navigateBackToHomeScreen, waitForActScreen, waitForHomeScreen } from '../helpers/navigation' import { checkIfElementWithTestIdExists, fillFieldByTestId, @@ -42,6 +42,8 @@ export const continueAsGuest = async () => { // Skip through all onboarding steps and continue as guet await skipOnboardingSteps() await tapOnElementWithTestId(testIdContinueAsGuest) + // User will land on act screen after onboarding > navigate to home feed + await tapOnElementWithTestId('btn-to-home-view') } await waitForHomeScreen() @@ -108,6 +110,9 @@ export const register = async ({ await finishAccountSetup() if (!userData?.content) { + // User will land on act screen after onboarding > navigate to home feed + await waitForActScreen() + await tapOnElementWithTestId('btn-to-home-view') await waitForHomeScreen() } } diff --git a/e2e/mobile/helpers/navigation.ts b/e2e/mobile/helpers/navigation.ts index e1ccb3d04225770e49080a7d4365812bbfc67af2..c3c216423d90c500666e24fae9c13fcf9e85ca8c 100644 --- a/e2e/mobile/helpers/navigation.ts +++ b/e2e/mobile/helpers/navigation.ts @@ -4,9 +4,12 @@ const homeScreenTestId = 'home-feed-insights-heading' export const waitForHomeScreen = async (timeout?: number) => waitForElementWithTestId(homeScreenTestId, timeout) +export const waitForActScreen = async (timeout?: number) => waitForElementWithTestId('act-home', timeout) + export const navigateToAppById = async (id: 'donations' | 'goodnews' | 'volunteering') => { await waitForHomeScreen() await tapOnElementWithTestId('btn-to-act') + await waitForElementWithTestId('act-home') await scrollToElementWithTestId(`${id}-reco-slider-heading-button`, 'down') await tapOnElementWithTestId(`${id}-reco-slider-heading-button`) await waitForElementWithTestId(`${id}-list-container`) diff --git a/e2e/web/tests/helpers.ts b/e2e/web/tests/helpers.ts index 26079da6b15fda9c2de8859a01aa9546643c9d3c..b0c3a97b4bd9f35c04f9e7f12b41b72ec8145e05 100644 --- a/e2e/web/tests/helpers.ts +++ b/e2e/web/tests/helpers.ts @@ -230,6 +230,9 @@ export const proceedAsGuest = async (page: Page): Promise<void> => { await clickElementByTestId(page, 'onboarding-account-creation-btn-continue-as-guest') await page.waitForSelector(byTestId('onboarding-account-creation-btn-continue-as-guest'), { state: 'detached' }) + + // User will land on act screen after onboarding > navigate to home feed + await clickElementByTestId(page, 'btn-to-home-view') } export const loginAsE2EUser = async (context: BrowserContext, page: Page): Promise<void> => { @@ -247,7 +250,7 @@ const registerNewUserAccount = async ( email, password, userData, - expectedScreen = 'home-feed-listing', + expectedScreen = 'act-home', }: { email?: string password?: string @@ -264,7 +267,7 @@ const registerNewUserAccount = async ( }) await page.waitForSelector(byTestId('community-guidelines-modal-btn-submit')) await clickElementByTestId(page, 'community-guidelines-modal-btn-submit') - // wait for expected screen (usually home feed) - registration succeeded + // wait for expected screen (usually act home) - registration succeeded await page.waitForSelector(byTestId(expectedScreen)) return newAccount } diff --git a/e2e/web/tests/registration.spec.ts b/e2e/web/tests/registration.spec.ts index d9a25d7b6f191460c45153e6b52164423d0da859..19325bd2cdc6dba2017e97fabe06a084cadf5181 100644 --- a/e2e/web/tests/registration.spec.ts +++ b/e2e/web/tests/registration.spec.ts @@ -32,8 +32,8 @@ test.describe('@Registration', () => { //FIXME: Error: Wasn't able to intercept user id while finishing account setup flow at finishAccountSetup in appointmentNotifications.spec.ts // using a random user session implicitly tests user registration await userHandler.asRandomUser(async (page) => { - // BUG: test-id: user-profile-full-name is not available on the page we are rendering. It is available on /profile. If that is intended behaviour, uncomment the next line - // await page.goto('/profile') + // Starting on profile page + // Ensure user is logged in await page.waitForSelector(byTestId('user-profile-full-name')) // trying to go to login page with logged in user should show home feed