From bc0220bc07784c624cae731c3a67ab7a73ed1c2b Mon Sep 17 00:00:00 2001 From: mcjoynt Date: Thu, 29 Apr 2021 15:59:21 -0500 Subject: [PATCH] fixed account test --- client/src/test/Account.test.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/client/src/test/Account.test.js b/client/src/test/Account.test.js index ac9f32c..13c6095 100644 --- a/client/src/test/Account.test.js +++ b/client/src/test/Account.test.js @@ -2,15 +2,36 @@ import { render, screen } from '@testing-library/react'; import { Provider } from 'react-redux'; import { BrowserRouter } from 'react-router-dom'; import store from '../store'; +import configureStore from 'redux-mock-store'; import Account from '../components/account/Account'; +const mockStore = configureStore([]); + +const authenticatedStore = mockStore({ + auth: { + token: localStorage.getItem('token'), + isAuthenticated: true, + user: { + first_name: 'Matt', + last_name: 'McJoynt', + username: 'mcjoynt', + email: 'user@email.com', + phone_number: '1234567890', + old_password: '123abc', + new_password: '1234abc', + confirmed_newpassword: '1234abc' + }, + loading: false, + } +}); + test('renders without crashing', () => { render( - + ); - // expect(screen.getByText('Account Update')).toBeInTheDocument(); + expect(screen.getByText('Account Update')).toBeInTheDocument(); });