-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import React from "react"; | ||
import { render, cleanup } from "@testing-library/react"; | ||
import "@testing-library/jest-dom/extend-expect"; | ||
import React from 'react'; | ||
import { cleanup } from '@testing-library/react'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
import ConnectedApp from "../src/ConnectedApp"; | ||
import ConnectedApp from '../src/ConnectedApp'; | ||
import { RenderWithRedux } from './Renderers'; | ||
|
||
afterEach(cleanup); | ||
|
||
describe("<ConnectedApp /> ", () => { | ||
it("renders without crashing", () => { | ||
const { getByText } = render(<ConnectedApp />); | ||
describe('<ConnectedApp /> ', () => { | ||
it('renders without crashing', () => { | ||
const { getByText } = RenderWithRedux(<ConnectedApp />); | ||
expect(getByText('Ethodoxy')).toBeInTheDocument(); | ||
expect(true).toBe(true); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { cleanup } from '@testing-library/react'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
import Error404 from '../src/components/Error404'; | ||
import { RenderWithRouter } from './Renderers'; | ||
|
||
afterEach(cleanup); | ||
|
||
describe('<Error404 /> ', () => { | ||
it('Displays error message', () => { | ||
const location = { pathname: 'unknown-path' }; | ||
const { getByText } = RenderWithRouter(<Error404 location={ location } />); | ||
expect(getByText('Error: 404')).toBeInTheDocument(); | ||
expect(getByText('The requested url' , { exact: false })).toBeInTheDocument(); | ||
expect(getByText('unknown-path' , { exact: false })).toBeInTheDocument(); | ||
expect(getByText('was not found on the server' , { exact: false })).toBeInTheDocument(); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { cleanup } from '@testing-library/react'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
import Footer from '../src/components/Footer'; | ||
import { RenderWithRouter } from './Renderers'; | ||
|
||
afterEach(cleanup); | ||
|
||
describe('<Footer /> ', () => { | ||
it('Displays correct message', () => { | ||
const { getByText } = RenderWithRouter(<Footer />); | ||
expect(getByText('Built with React and material UI by orjichidi95@gmail.com')).toBeInTheDocument(); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { cleanup } from '@testing-library/react'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
import Home from '../src/components/Home'; | ||
import { RenderWithRouter } from './Renderers'; | ||
|
||
afterEach(cleanup); | ||
|
||
describe('<Home /> ', () => { | ||
it('renders without crashing', () => { | ||
const { getByText } = RenderWithRouter(<Home />); | ||
expect(getByText('Douay-Rheims Bible')).toBeInTheDocument(); | ||
expect(getByText('Challoner Commentary')).toBeInTheDocument(); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from 'react'; | ||
|
||
import { Router } from 'react-router-dom'; | ||
import { createMemoryHistory } from 'history'; | ||
|
||
import { createStore } from 'redux'; | ||
import { Provider } from 'react-redux'; | ||
import rootReducer from '../src/reducers/rootReducer'; | ||
|
||
import { render } from '@testing-library/react'; | ||
|
||
// for apps that has react-router functions such as <Link> | ||
export const RenderWithRouter = ( | ||
ui, | ||
{ route = '/', history=createMemoryHistory({ initialEntries: [ route ] }) } = {} | ||
) => { | ||
return { | ||
...render( | ||
<Router history={history}> | ||
{ ui } | ||
</Router>), | ||
history }; | ||
}; | ||
|
||
// for apps that are connected to the store | ||
export const RenderWithRedux = (ui, { store=createStore(rootReducer) } = {} | ||
) => { | ||
return { | ||
...render( | ||
<Provider store={store}> | ||
{ ui } | ||
</Provider>), | ||
store }; | ||
}; | ||
|
||
export const RenderWithReduxAndRouter = ( | ||
ui, | ||
{ store=createStore(rootReducer) } = {}, | ||
{ route = '/', history=createMemoryHistory({ initialEntries: [ route ] }) } = {} | ||
) => { | ||
return { | ||
...render( | ||
<Provider store={store}> | ||
<Router history={history}> | ||
{ ui } | ||
</Router> | ||
</Provider> | ||
), | ||
history, | ||
store, | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
{ | ||
"files": { | ||
"main.css": "/Ethodoxy/static/css/main.ed2fa934.chunk.css", | ||
"main.js": "/Ethodoxy/static/js/main.b825e0d6.chunk.js", | ||
"main.js.map": "/Ethodoxy/static/js/main.b825e0d6.chunk.js.map", | ||
"runtime~main.js": "/Ethodoxy/static/js/runtime~main.a539204c.js", | ||
"runtime~main.js.map": "/Ethodoxy/static/js/runtime~main.a539204c.js.map", | ||
"main.css": "/Ethodoxy/static/css/main.b95623cc.chunk.css", | ||
"main.js": "/Ethodoxy/static/js/main.437aba48.chunk.js", | ||
"main.js.map": "/Ethodoxy/static/js/main.437aba48.chunk.js.map", | ||
"runtime~main.js": "/Ethodoxy/static/js/runtime~main.3009cdca.js", | ||
"runtime~main.js.map": "/Ethodoxy/static/js/runtime~main.3009cdca.js.map", | ||
"static/css/2.5ec480d0.chunk.css": "/Ethodoxy/static/css/2.5ec480d0.chunk.css", | ||
"static/js/2.6bb17d7c.chunk.js": "/Ethodoxy/static/js/2.6bb17d7c.chunk.js", | ||
"static/js/2.6bb17d7c.chunk.js.map": "/Ethodoxy/static/js/2.6bb17d7c.chunk.js.map", | ||
"static/js/3.95283352.chunk.js": "/Ethodoxy/static/js/3.95283352.chunk.js", | ||
"static/js/3.95283352.chunk.js.map": "/Ethodoxy/static/js/3.95283352.chunk.js.map", | ||
"static/js/2.9de6b015.chunk.js": "/Ethodoxy/static/js/2.9de6b015.chunk.js", | ||
"static/js/2.9de6b015.chunk.js.map": "/Ethodoxy/static/js/2.9de6b015.chunk.js.map", | ||
"static/js/3.89395b3c.chunk.js": "/Ethodoxy/static/js/3.89395b3c.chunk.js", | ||
"static/js/3.89395b3c.chunk.js.map": "/Ethodoxy/static/js/3.89395b3c.chunk.js.map", | ||
"static/js/4.3a0d7394.chunk.js": "/Ethodoxy/static/js/4.3a0d7394.chunk.js", | ||
"static/js/4.3a0d7394.chunk.js.map": "/Ethodoxy/static/js/4.3a0d7394.chunk.js.map", | ||
"static/js/5.fa0e89c4.chunk.js": "/Ethodoxy/static/js/5.fa0e89c4.chunk.js", | ||
"static/js/5.fa0e89c4.chunk.js.map": "/Ethodoxy/static/js/5.fa0e89c4.chunk.js.map", | ||
"index.html": "/Ethodoxy/index.html", | ||
"precache-manifest.17c617626b1203a1018ebdc8d411b565.js": "/Ethodoxy/precache-manifest.17c617626b1203a1018ebdc8d411b565.js", | ||
"precache-manifest.3cc09331e48f75db0c5463bf1b6c9898.js": "/Ethodoxy/precache-manifest.3cc09331e48f75db0c5463bf1b6c9898.js", | ||
"service-worker.js": "/Ethodoxy/service-worker.js", | ||
"static/css/2.5ec480d0.chunk.css.map": "/Ethodoxy/static/css/2.5ec480d0.chunk.css.map", | ||
"static/css/main.ed2fa934.chunk.css.map": "/Ethodoxy/static/css/main.ed2fa934.chunk.css.map" | ||
"static/css/main.b95623cc.chunk.css.map": "/Ethodoxy/static/css/main.b95623cc.chunk.css.map" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/Ethodoxy/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><link rel="manifest" href="/Ethodoxy/manifest.json"/><title>React App</title><link href="/Ethodoxy/static/css/2.5ec480d0.chunk.css" rel="stylesheet"><link href="/Ethodoxy/static/css/main.ed2fa934.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><section id="root"></section><script>!function(c){function e(e){for(var t,r,n=e[0],o=e[1],u=e[2],i=0,a=[];i<n.length;i++)r=n[i],f[r]&&a.push(f[r][0]),f[r]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(c[t]=o[t]);for(d&&d(e);a.length;)a.shift()();return p.push.apply(p,u||[]),l()}function l(){for(var e,t=0;t<p.length;t++){for(var r=p[t],n=!0,o=1;o<r.length;o++){var u=r[o];0!==f[u]&&(n=!1)}n&&(p.splice(t--,1),e=s(s.s=r[0]))}return e}var r={},f={1:0},p=[];function s(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return c[e].call(t.exports,t,t.exports,s),t.l=!0,t.exports}s.e=function(u){var e=[],r=f[u];if(0!==r)if(r)e.push(r[2]);else{var t=new Promise(function(e,t){r=f[u]=[e,t]});e.push(r[2]=t);var n,i=document.createElement("script");i.charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.src=s.p+"static/js/"+({}[u]||u)+"."+{3:"95283352"}[u]+".chunk.js",n=function(e){i.onerror=i.onload=null,clearTimeout(a);var t=f[u];if(0!==t){if(t){var r=e&&("load"===e.type?"missing":e.type),n=e&&e.target&&e.target.src,o=new Error("Loading chunk "+u+" failed.\n("+r+": "+n+")");o.type=r,o.request=n,t[1](o)}f[u]=void 0}};var a=setTimeout(function(){n({type:"timeout",target:i})},12e4);i.onerror=i.onload=n,document.head.appendChild(i)}return Promise.all(e)},s.m=c,s.c=r,s.d=function(e,t,r){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(s.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(r,n,function(e){return t[e]}.bind(null,n));return r},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/Ethodoxy/",s.oe=function(e){throw console.error(e),e};var t=window.webpackJsonp=window.webpackJsonp||[],n=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var d=n;l()}([])</script><script src="/Ethodoxy/static/js/2.6bb17d7c.chunk.js"></script><script src="/Ethodoxy/static/js/main.b825e0d6.chunk.js"></script></body></html> | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/Ethodoxy/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><link rel="manifest" href="/Ethodoxy/manifest.json"/><title>React App</title><link href="/Ethodoxy/static/css/2.5ec480d0.chunk.css" rel="stylesheet"><link href="/Ethodoxy/static/css/main.b95623cc.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><section id="root"></section><script>!function(c){function e(e){for(var t,r,n=e[0],o=e[1],u=e[2],i=0,a=[];i<n.length;i++)r=n[i],f[r]&&a.push(f[r][0]),f[r]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(c[t]=o[t]);for(d&&d(e);a.length;)a.shift()();return p.push.apply(p,u||[]),l()}function l(){for(var e,t=0;t<p.length;t++){for(var r=p[t],n=!0,o=1;o<r.length;o++){var u=r[o];0!==f[u]&&(n=!1)}n&&(p.splice(t--,1),e=s(s.s=r[0]))}return e}var r={},f={1:0},p=[];function s(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return c[e].call(t.exports,t,t.exports,s),t.l=!0,t.exports}s.e=function(u){var e=[],r=f[u];if(0!==r)if(r)e.push(r[2]);else{var t=new Promise(function(e,t){r=f[u]=[e,t]});e.push(r[2]=t);var n,i=document.createElement("script");i.charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.src=s.p+"static/js/"+({}[u]||u)+"."+{3:"89395b3c",4:"3a0d7394",5:"fa0e89c4"}[u]+".chunk.js",n=function(e){i.onerror=i.onload=null,clearTimeout(a);var t=f[u];if(0!==t){if(t){var r=e&&("load"===e.type?"missing":e.type),n=e&&e.target&&e.target.src,o=new Error("Loading chunk "+u+" failed.\n("+r+": "+n+")");o.type=r,o.request=n,t[1](o)}f[u]=void 0}};var a=setTimeout(function(){n({type:"timeout",target:i})},12e4);i.onerror=i.onload=n,document.head.appendChild(i)}return Promise.all(e)},s.m=c,s.c=r,s.d=function(e,t,r){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(s.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(r,n,function(e){return t[e]}.bind(null,n));return r},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/Ethodoxy/",s.oe=function(e){throw console.error(e),e};var t=window.webpackJsonp=window.webpackJsonp||[],n=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var d=n;l()}([])</script><script src="/Ethodoxy/static/js/2.9de6b015.chunk.js"></script><script src="/Ethodoxy/static/js/main.437aba48.chunk.js"></script></body></html> |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
self.__precacheManifest = (self.__precacheManifest || []).concat([ | ||
{ | ||
"revision": "bee691fbc3a01c6559ecc1b9fbc34b88", | ||
"url": "/Ethodoxy/index.html" | ||
}, | ||
{ | ||
"revision": "df3011f12bb57b689b66", | ||
"url": "/Ethodoxy/static/css/2.5ec480d0.chunk.css" | ||
}, | ||
{ | ||
"revision": "3876ceaf77fc48608681", | ||
"url": "/Ethodoxy/static/css/main.b95623cc.chunk.css" | ||
}, | ||
{ | ||
"revision": "df3011f12bb57b689b66", | ||
"url": "/Ethodoxy/static/js/2.9de6b015.chunk.js" | ||
}, | ||
{ | ||
"revision": "827877056fff120ed583", | ||
"url": "/Ethodoxy/static/js/3.89395b3c.chunk.js" | ||
}, | ||
{ | ||
"revision": "015360928b3342c3fc85", | ||
"url": "/Ethodoxy/static/js/4.3a0d7394.chunk.js" | ||
}, | ||
{ | ||
"revision": "7f954964684244cc514f", | ||
"url": "/Ethodoxy/static/js/5.fa0e89c4.chunk.js" | ||
}, | ||
{ | ||
"revision": "3876ceaf77fc48608681", | ||
"url": "/Ethodoxy/static/js/main.437aba48.chunk.js" | ||
}, | ||
{ | ||
"revision": "637ea8c9062c4f13b00f", | ||
"url": "/Ethodoxy/static/js/runtime~main.3009cdca.js" | ||
} | ||
]); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.