Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
464 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -29,3 +29,4 @@ server/uploads/ | ||
server/public/ | ||
server/yarn.lock | ||
client/package-lock.json | ||
package-lock.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import App from './App'; | ||
import {render, 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'; | ||
|
||
test('renders learn react link', () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/learn react/i); | ||
render( | ||
<Provider store={createStore(reducers, composeEnhancers(applyMiddleware(reduxThunk)))}> | ||
<App /> | ||
</Provider>, | ||
); | ||
const linkElement = screen.getByText(/WELCOME TO BORROW PLATFORM/i); | ||
expect(linkElement).toBeInTheDocument(); | ||
}); |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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(); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env" | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"node": "current" | ||
} | ||
} | ||
] | ||
|
||
], | ||
"plugins": [ | ||
["transform-class-properties", { "spec": true }] | ||
] | ||
} | ||
"plugins": [["transform-class-properties", {"spec": true}]] | ||
|
||
} |
Oops, something went wrong.