import {dirname, resolve} from 'path' import React from 'react'; import { fireEvent, render, screen } from '@testing-library/react-native'; import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import TTNavStack from '../TTNavStack'; // Mock the expo-file-system/next module jest.mock('expo-file-system/next', () => ({ File: jest.fn(), Paths: { join: jest.fn(), }, })); const Stack = createStackNavigator(); describe('Navigation', () => { beforeEach(() => { // Reset the navigation state before each test jest.clearAllMocks(); }); it('Navigates to ConversationThread on language selection', async () => { render(); const languageSelectionText = await screen.findByText("Language Selection"); fireEvent.press(languageSelectionText); expect(await screen.findByText("Conversation Thread")).toBeOnTheScreen(); }); it('Navigates to Settings on settings selection', async () => { render(); const settingsButton = await screen.findByText("Settings"); fireEvent.press(settingsButton); expect(await screen.findByText("Settings")).toBeOnTheScreen(); }); });