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
// app/_layout.tsx | |
import { Drawer } from 'expo-router/drawer'; | |
export const unstable_settings = { | |
// Ensure any route can link back to `/` | |
initialRouteName: 'index', | |
}; | |
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
import useAuth from '#hooks/useAuth'; | |
import AuthContext from '#state/AuthContext'; | |
import { User } from '#types/User'; | |
import { router } from 'expo-router'; | |
import { Drawer } from 'expo-router/drawer'; | |
import { usePathname } from 'expo-router/src/hooks'; | |
import { useEffect, useMemo, useState } from 'react'; | |
export const unstable_settings = { | |
// Ensure any route can link back to `/` |
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
describe('New Listing page', () => { | |
renderRouter({ | |
'new-listing': NewListingPage, | |
'listings/[id]': ListingPage, | |
'feed': FeedPage, | |
'_layout': Layout | |
}, { | |
initialUrl: '/' | |
}); | |
// ... |
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
fireEvent.changeText(title_comp, TITLE) | |
fireEvent.changeText(description_comp, DESCRIPTION); | |
fireEvent.press(save_button); // This causes the route to change | |
await waitFor(() => expect(screen).toHavePathname('/listings/' + LISTING_ID), {timeout: 10 * 1000, interval: 1000}); | |
const title_comp_2 = await waitFor(() => screen.getByText(TITLE)); // Error here | |
const description_comp_2 = await waitFor(() => screen.getByText(DESCRIPTION)); | |
const author_comp = await waitFor(() => screen.getByText('By ' + AUTHOR_NAME)); |