diff --git a/mobile/__tests__/CreatePost.test.js b/mobile/__tests__/CreatePost.test.js index 06258433..347bc69f 100644 --- a/mobile/__tests__/CreatePost.test.js +++ b/mobile/__tests__/CreatePost.test.js @@ -1,12 +1,11 @@ import React from 'react'; import { render, fireEvent, waitFor } from '@testing-library/react-native'; -import CreatePost from '../src/pages/CreatePost'; // Adjust the import as necessary -import { useAuth } from '../src/hooks/useAuth'; // Adjust the import path as necessary +import CreatePost from '../src/pages/CreatePost'; +import { useAuth } from '../src/hooks/useAuth'; -// Mock useAuth hook jest.mock('../src/hooks/useAuth', () => ({ useAuth: () => ({ - accessToken: 'mockAccessToken', // Provide a default or mock value + accessToken: 'mockAccessToken', userId: 'mockUserId', }), })); @@ -18,7 +17,7 @@ describe('CreatePost Component', () => { it('toggles tag selection', () => { const { getByText, getByTestId } = render(); - const tagChip = getByText('Tech'); // Assuming 'Tech' is the text of the tag chip + const tagChip = getByText('Tech'); fireEvent.press(tagChip); expect(getByText("Tech").props.style.backgroundColor).toBe("#007BFF"); diff --git a/mobile/__tests__/Post.test.js b/mobile/__tests__/Post.test.js index f918a04a..a3efbe39 100644 --- a/mobile/__tests__/Post.test.js +++ b/mobile/__tests__/Post.test.js @@ -1,7 +1,7 @@ import React from 'react'; import renderer from 'react-test-renderer'; import { render, waitFor, fireEvent } from '@testing-library/react-native'; -import Post from '../src/pages/Post'; // Adjust the import as necessary +import Post from '../src/pages/Post'; jest.mock('node-fetch', () => require('jest-fetch-mock')); diff --git a/mobile/__tests__/Profile-test.js b/mobile/__tests__/Profile-test.js index e23084f5..396331e7 100644 --- a/mobile/__tests__/Profile-test.js +++ b/mobile/__tests__/Profile-test.js @@ -2,7 +2,7 @@ import React from 'react'; import renderer from 'react-test-renderer'; import Profile from '../src/pages/ProfilePage'; -// Mock the useAuth hook + jest.mock('../src/pages/context/AuthContext', () => ({ useAuth: () => ({ username: 'testuser', diff --git a/mobile/src/pages/App.js b/mobile/src/pages/App.js index f5999e66..bb31260c 100644 --- a/mobile/src/pages/App.js +++ b/mobile/src/pages/App.js @@ -19,9 +19,6 @@ import Community from './Community'; import Post from './Post'; import CreatePost from './CreatePost'; import StockDetails from './StockDetails'; -import Portfolio from './Portfolio'; -import PortfolioDetails from './PortfolioDetails'; -import CreatePortfolio from './CreatePortfolio'; import { AuthProvider, useAuth } from './context/AuthContext'; @@ -92,31 +89,6 @@ const MarketsStack = () => ( ); -const PortfolioStack = () => ( - - }} - /> - - - - -); - const DrawerNavigator = () => { const { username, userId } = useAuth(); @@ -130,6 +102,11 @@ const DrawerNavigator = () => { }} > + { options={{ headerShown: false }} /> - + - { userId ? ( - - ) : ( - - )} ); @@ -198,7 +158,7 @@ const App = () => { const styles = StyleSheet.create({ customHeader: { height: 60, - backgroundColor: '#007BFF', + backgroundColor: '#0077B6', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between',