Skip to content
Permalink
5a6be2c734
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
30 lines (26 sloc) 1.17 KB
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();
});