Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add books to homepage #5

Merged
merged 6 commits into from
Jul 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# testing
/coverage

.vscode/

# misc
.DS_Store
.env.local
Expand Down
23 changes: 23 additions & 0 deletions __mocks__/axios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* eslint-disable no-undef */
export default {
post: jest.fn().mockImplementation(() => Promise.resolve({
data: {
data: {},
token: ''
}
})),

get: jest.fn().mockImplementation(() => Promise.resolve({
books: []
})),

defaults: {
headers: {
post: {
'Content-Type': 'application/json',
},
common: {}
},
baseURL: '',
}
};
3 changes: 0 additions & 3 deletions __tests__/App.test.js → __tests__/ConnectedApp.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import React from 'react';
import { cleanup } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';

import ConnectedApp from '../src/ConnectedApp';
import { RenderWithRedux } from './Renderers';

afterEach(cleanup);

describe('<ConnectedApp /> ', () => {
it('renders without crashing', () => {
const { getByText } = RenderWithRedux(<ConnectedApp />);
Expand Down
3 changes: 0 additions & 3 deletions __tests__/Error404.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
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' };
Expand Down
13 changes: 7 additions & 6 deletions __tests__/Home.test.js
Original file line number Diff line number Diff line change
@@ -1,15 +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);
import { RenderWithReduxAndRouter } from './Renderers';
import utils from '../src/actions/utils';

describe('<Home /> ', () => {
it('renders without crashing', () => {
const { getByText } = RenderWithRouter(<Home />);
it('renders without crashing', async () => {
utils.getPaginatedItems = jest.fn().mockImplementationOnce(() => ({
books: []
}));
const { getByText } = RenderWithReduxAndRouter(<Home />);
expect(getByText('Douay-Rheims Bible')).toBeInTheDocument();
expect(getByText('Challoner Commentary')).toBeInTheDocument();
});
Expand Down
26 changes: 13 additions & 13 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"files": {
"main.css": "/Ethodoxy/static/css/main.b676491d.chunk.css",
"main.js": "/Ethodoxy/static/js/main.22430d85.chunk.js",
"main.js.map": "/Ethodoxy/static/js/main.22430d85.chunk.js.map",
"runtime~main.js": "/Ethodoxy/static/js/runtime~main.e59d4e58.js",
"runtime~main.js.map": "/Ethodoxy/static/js/runtime~main.e59d4e58.js.map",
"main.js": "/Ethodoxy/static/js/main.9d5eb37a.chunk.js",
"main.js.map": "/Ethodoxy/static/js/main.9d5eb37a.chunk.js.map",
"runtime~main.js": "/Ethodoxy/static/js/runtime~main.25c407d9.js",
"runtime~main.js.map": "/Ethodoxy/static/js/runtime~main.25c407d9.js.map",
"static/css/2.5d832d7a.chunk.css": "/Ethodoxy/static/css/2.5d832d7a.chunk.css",
"static/js/2.35bb070b.chunk.js": "/Ethodoxy/static/js/2.35bb070b.chunk.js",
"static/js/2.35bb070b.chunk.js.map": "/Ethodoxy/static/js/2.35bb070b.chunk.js.map",
"static/js/3.c32e13c7.chunk.js": "/Ethodoxy/static/js/3.c32e13c7.chunk.js",
"static/js/3.c32e13c7.chunk.js.map": "/Ethodoxy/static/js/3.c32e13c7.chunk.js.map",
"static/js/4.3da62355.chunk.js": "/Ethodoxy/static/js/4.3da62355.chunk.js",
"static/js/4.3da62355.chunk.js.map": "/Ethodoxy/static/js/4.3da62355.chunk.js.map",
"static/js/5.1b552df0.chunk.js": "/Ethodoxy/static/js/5.1b552df0.chunk.js",
"static/js/5.1b552df0.chunk.js.map": "/Ethodoxy/static/js/5.1b552df0.chunk.js.map",
"static/js/2.114a3a32.chunk.js": "/Ethodoxy/static/js/2.114a3a32.chunk.js",
"static/js/2.114a3a32.chunk.js.map": "/Ethodoxy/static/js/2.114a3a32.chunk.js.map",
"static/js/3.a49cdf27.chunk.js": "/Ethodoxy/static/js/3.a49cdf27.chunk.js",
"static/js/3.a49cdf27.chunk.js.map": "/Ethodoxy/static/js/3.a49cdf27.chunk.js.map",
"static/js/4.c18c74de.chunk.js": "/Ethodoxy/static/js/4.c18c74de.chunk.js",
"static/js/4.c18c74de.chunk.js.map": "/Ethodoxy/static/js/4.c18c74de.chunk.js.map",
"static/js/5.f046343d.chunk.js": "/Ethodoxy/static/js/5.f046343d.chunk.js",
"static/js/5.f046343d.chunk.js.map": "/Ethodoxy/static/js/5.f046343d.chunk.js.map",
"index.html": "/Ethodoxy/index.html",
"precache-manifest.e73797ae6c7a3686587a04dd5e2ff7f6.js": "/Ethodoxy/precache-manifest.e73797ae6c7a3686587a04dd5e2ff7f6.js",
"precache-manifest.d9d865af60e89dba75c65b182468e057.js": "/Ethodoxy/precache-manifest.d9d865af60e89dba75c65b182468e057.js",
"service-worker.js": "/Ethodoxy/service-worker.js",
"static/css/2.5d832d7a.chunk.css.map": "/Ethodoxy/static/css/2.5d832d7a.chunk.css.map",
"static/css/main.b676491d.chunk.css.map": "/Ethodoxy/static/css/main.b676491d.chunk.css.map"
Expand Down
2 changes: 1 addition & 1 deletion build/index.html
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>Ethodoxy</title><link href="/Ethodoxy/static/css/2.5d832d7a.chunk.css" rel="stylesheet"><link href="/Ethodoxy/static/css/main.b676491d.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:"c32e13c7",4:"3da62355",5:"1b552df0"}[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.35bb070b.chunk.js"></script><script src="/Ethodoxy/static/js/main.22430d85.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>Ethodoxy</title><link href="/Ethodoxy/static/css/2.5d832d7a.chunk.css" rel="stylesheet"><link href="/Ethodoxy/static/css/main.b676491d.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],l[r]&&a.push(l[r][0]),l[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||[]),f()}function f(){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!==l[u]&&(n=!1)}n&&(p.splice(t--,1),e=s(s.s=r[0]))}return e}var r={},l={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=l[u];if(0!==r)if(r)e.push(r[2]);else{var t=new Promise(function(e,t){r=l[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:"a49cdf27",4:"c18c74de",5:"f046343d"}[u]+".chunk.js",n=function(e){i.onerror=i.onload=null,clearTimeout(a);var t=l[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)}l[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;f()}([])</script><script src="/Ethodoxy/static/js/2.114a3a32.chunk.js"></script><script src="/Ethodoxy/static/js/main.9d5eb37a.chunk.js"></script></body></html>
38 changes: 38 additions & 0 deletions build/precache-manifest.d9d865af60e89dba75c65b182468e057.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "d9a539c96218cb375fe7dff4997d0ac7",
"url": "/Ethodoxy/index.html"
},
{
"revision": "a952fc318107fce07d5d",
"url": "/Ethodoxy/static/css/2.5d832d7a.chunk.css"
},
{
"revision": "9f9ab67df1bcf8a8706d",
"url": "/Ethodoxy/static/css/main.b676491d.chunk.css"
},
{
"revision": "a952fc318107fce07d5d",
"url": "/Ethodoxy/static/js/2.114a3a32.chunk.js"
},
{
"revision": "4416396e5787527a43f2",
"url": "/Ethodoxy/static/js/3.a49cdf27.chunk.js"
},
{
"revision": "931a1cdfadb843f173d7",
"url": "/Ethodoxy/static/js/4.c18c74de.chunk.js"
},
{
"revision": "0cb5028beefff33ed482",
"url": "/Ethodoxy/static/js/5.f046343d.chunk.js"
},
{
"revision": "9f9ab67df1bcf8a8706d",
"url": "/Ethodoxy/static/js/main.9d5eb37a.chunk.js"
},
{
"revision": "0cf5419082e806b14976",
"url": "/Ethodoxy/static/js/runtime~main.25c407d9.js"
}
]);
38 changes: 0 additions & 38 deletions build/precache-manifest.e73797ae6c7a3686587a04dd5e2ff7f6.js

This file was deleted.

2 changes: 1 addition & 1 deletion build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"/Ethodoxy/precache-manifest.e73797ae6c7a3686587a04dd5e2ff7f6.js"
"/Ethodoxy/precache-manifest.d9d865af60e89dba75c65b182468e057.js"
);

self.addEventListener('message', (event) => {
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/static/js/2.114a3a32.chunk.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion build/static/js/2.35bb070b.chunk.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions build/static/js/3.a49cdf27.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/static/js/3.a49cdf27.chunk.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions build/static/js/3.c32e13c7.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion build/static/js/3.c32e13c7.chunk.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions build/static/js/4.3da62355.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion build/static/js/4.3da62355.chunk.js.map

This file was deleted.