Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
frontend/client/src/test/component.test.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
30 lines (26 sloc)
1.17 KB
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 React from 'react'; | |
import {render, fireEvent, screen} from '@testing-library/react'; | |
import {createStore, applyMiddleware, compose} from 'redux'; | |
import reducers from '../reducers'; | |
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; | |
import {Provider} from 'react-redux'; | |
import reduxThunk from 'redux-thunk'; | |
import {Router, Route, Switch} from 'react-router-dom'; | |
import {createBrowserHistory} from 'history'; | |
const history = createBrowserHistory(); | |
import MyNav from '../components/component.mynav'; | |
it('shows success message after confirm button is clicked', () => { | |
const {getByText} = render( | |
<Provider store={createStore(reducers, composeEnhancers(applyMiddleware(reduxThunk)))}> | |
<Router history={history}> | |
<MyNav history={history} /> | |
</Router> | |
</Provider>, | |
); | |
expect(screen.getByText(/My Book List/i)).toBeInTheDocument(); | |
expect(screen.getByText(/Release/i)).toBeInTheDocument(); | |
expect(screen.getByText(/Request List/i)).toBeInTheDocument(); | |
expect(screen.getByText(/Borrow List/i)).toBeInTheDocument(); | |
// fireEvent.click(getByText('Confirm')); | |
// expect(getByText('Confirmed!')).toBeInTheDocument(); | |
}); |