From 47c1301a56dcf70f8118953bebeaf0c10df6e3cb Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 09:23:34 -0700 Subject: [PATCH 01/14] Update dependancies --- package-lock.json | 388 +++++++++++++++++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 346 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4e1f93d..a50b1a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1377,9 +1377,9 @@ "integrity": "sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A==" }, "@types/node": { - "version": "12.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz", - "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w==", + "version": "13.1.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.7.tgz", + "integrity": "sha512-HU0q9GXazqiKwviVxg9SI/+t/nAsGkvLDkIdxz+ObejG2nX6Si00TeLqHMoS+a/1tjH7a8YpKVQwtgHuMQsldg==", "dev": true }, "@types/q": { @@ -1877,14 +1877,92 @@ } }, "array.prototype.flat": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz", - "integrity": "sha512-rVqIs330nLJvfC7JqYvEWwqVr5QjYF1ib02i3YJtR/fICO6527Tjpc/e4Mvmxh3GIePPreRXMdaGyC99YphWEw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.10.0", - "function-bind": "^1.1.1" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.1.tgz", + "integrity": "sha512-WmWNHWmm/LDwK8jaeZic/g6sU1ZckM+vvOyCV1qFRhJJ6hzve6DRgthNQB7Lra1ocrw68HexLKYgtdxIPcb3Fg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + } } }, "arrify": { @@ -4570,32 +4648,159 @@ "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==" }, "enzyme": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/enzyme/-/enzyme-3.10.0.tgz", - "integrity": "sha512-p2yy9Y7t/PFbPoTvrWde7JIYB2ZyGC+NgTNbVEGvZ5/EyoYSr9aG/2rSbVvyNvMHEhw9/dmGUJHWtfQIEiX9pg==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/enzyme/-/enzyme-3.11.0.tgz", + "integrity": "sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw==", "dev": true, "requires": { - "array.prototype.flat": "^1.2.1", - "cheerio": "^1.0.0-rc.2", - "function.prototype.name": "^1.1.0", + "array.prototype.flat": "^1.2.3", + "cheerio": "^1.0.0-rc.3", + "enzyme-shallow-equal": "^1.0.1", + "function.prototype.name": "^1.1.2", "has": "^1.0.3", - "html-element-map": "^1.0.0", - "is-boolean-object": "^1.0.0", - "is-callable": "^1.1.4", - "is-number-object": "^1.0.3", - "is-regex": "^1.0.4", - "is-string": "^1.0.4", + "html-element-map": "^1.2.0", + "is-boolean-object": "^1.0.1", + "is-callable": "^1.1.5", + "is-number-object": "^1.0.4", + "is-regex": "^1.0.5", + "is-string": "^1.0.5", "is-subset": "^0.1.1", "lodash.escape": "^4.0.1", "lodash.isequal": "^4.5.0", - "object-inspect": "^1.6.0", - "object-is": "^1.0.1", + "object-inspect": "^1.7.0", + "object-is": "^1.0.2", "object.assign": "^4.1.0", - "object.entries": "^1.0.4", - "object.values": "^1.0.4", - "raf": "^3.4.0", + "object.entries": "^1.1.1", + "object.values": "^1.1.1", + "raf": "^3.4.1", "rst-selector-parser": "^2.2.3", - "string.prototype.trim": "^1.1.2" + "string.prototype.trim": "^1.2.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.1.tgz", + "integrity": "sha512-WmWNHWmm/LDwK8jaeZic/g6sU1ZckM+vvOyCV1qFRhJJ6hzve6DRgthNQB7Lra1ocrw68HexLKYgtdxIPcb3Fg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "function.prototype.name": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.2.tgz", + "integrity": "sha512-C8A+LlHBJjB2AdcRPorc5JvJ5VUoWlXdEHLOJdCI7kjHEtGTpHQUiqMvCIKUwIsGwZX2jZJy761AXsn356bJQg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "functions-have-names": "^1.2.0" + } + }, + "functions-have-names": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.0.tgz", + "integrity": "sha512-zKXyzksTeaCSw5wIX79iCA40YAa6CJMJgNg9wdkU/ERBrIdPSimPICYiLp65lRbSBqtiHql/HZfS2DyI/AH6tQ==", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.2.tgz", + "integrity": "sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==", + "dev": true + }, + "object.entries": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.1.tgz", + "integrity": "sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + } } }, "enzyme-adapter-react-16": { @@ -4644,6 +4849,24 @@ } } }, + "enzyme-shallow-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.1.tgz", + "integrity": "sha512-hGA3i1so8OrYOZSM9whlkNmVHOicJpsjgTzC+wn2JMJXhq1oO4kA4bJ5MsfzSIcC71aLDKzJ6gZpIxrqt3QTAQ==", + "dev": true, + "requires": { + "has": "^1.0.3", + "object-is": "^1.0.2" + }, + "dependencies": { + "object-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.2.tgz", + "integrity": "sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==", + "dev": true + } + } + }, "enzyme-to-json": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/enzyme-to-json/-/enzyme-to-json-3.4.0.tgz", @@ -6240,9 +6463,9 @@ "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==" }, "html-element-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/html-element-map/-/html-element-map-1.1.0.tgz", - "integrity": "sha512-iqiG3dTZmy+uUaTmHarTL+3/A2VW9ox/9uasKEZC+R/wAtUrTcRlXPSaPqsnWPfIu8wqn09jQNwMRqzL54jSYA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/html-element-map/-/html-element-map-1.2.0.tgz", + "integrity": "sha512-0uXq8HsuG1v2TmQ8QkIhzbrqeskE4kn52Q18QJ9iAA/SnHoEKXWiUxHQtclRsCFWEUD2So34X+0+pZZu862nnw==", "dev": true, "requires": { "array-filter": "^1.0.0" @@ -6594,9 +6817,9 @@ } }, "is-boolean-object": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.0.0.tgz", - "integrity": "sha1-mPiygDBoQhmpXzdc+9iM40Bd/5M=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.0.1.tgz", + "integrity": "sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ==", "dev": true }, "is-buffer": { @@ -6702,9 +6925,9 @@ } }, "is-number-object": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.3.tgz", - "integrity": "sha1-8mWrian0RQNO9q/xWo8AsA9VF5k=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", + "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", "dev": true }, "is-obj": { @@ -6775,9 +6998,9 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, "is-string": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.4.tgz", - "integrity": "sha1-zDqbaYV9Yh6WNyWiTK7shzuCbmQ=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", "dev": true }, "is-subset": { @@ -12149,14 +12372,93 @@ } }, "string.prototype.trim": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.0.tgz", - "integrity": "sha512-9EIjYD/WdlvLpn987+ctkLf0FfvBefOCuiEr2henD8X+7jfwPnyvTdmW8OJhj5p+M0/96mBdynLWkxUr+rHlpg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.1.tgz", + "integrity": "sha512-MjGFEeqixw47dAMFMtgUro/I0+wNqZB5GKXGt1fFr24u3TzDXCPu7J9Buppzoe3r/LqkSDLDDJzE15RGWDGAVw==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.13.0", + "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.1.tgz", + "integrity": "sha512-WmWNHWmm/LDwK8jaeZic/g6sU1ZckM+vvOyCV1qFRhJJ6hzve6DRgthNQB7Lra1ocrw68HexLKYgtdxIPcb3Fg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + } } }, "string.prototype.trimleft": { diff --git a/package.json b/package.json index 63a7cca..0629ac1 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ ] }, "devDependencies": { - "enzyme": "^3.10.0", + "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.14.0", "enzyme-to-json": "^3.4.0" }, From 03154262ac97972fe6a9783ab0ec232068014007 Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 09:24:05 -0700 Subject: [PATCH 02/14] Add error handle on handleSubmit in welcome modal --- src/containers/WelcomeModal/WelcomeModal.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/containers/WelcomeModal/WelcomeModal.js b/src/containers/WelcomeModal/WelcomeModal.js index e7ae481..dfc0f39 100644 --- a/src/containers/WelcomeModal/WelcomeModal.js +++ b/src/containers/WelcomeModal/WelcomeModal.js @@ -22,7 +22,9 @@ export class WelcomeModal extends Component { handleSubmit = e => { const { firstName, lastName, feeling } = this.state; - e.preventDefault(); + if (firstName === '' || lastName === '' || feeling === '') { + return this.setState({error: "Please make sure you've filled everything out!"}); + } this.props.createUser({ id: Date.now(), firstName, @@ -68,7 +70,7 @@ export class WelcomeModal extends Component { - From c1fa43fa76f3d6943fbd530041d2409211bb4187 Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 09:31:19 -0700 Subject: [PATCH 03/14] Add delete and submit messages actions --- src/actions/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/actions/index.js b/src/actions/index.js index 7872340..06791be 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -10,4 +10,13 @@ export const removeUser = () => ({ export const hasErrored = errorMsg => ({ type: 'HAS_ERRORED', errorMsg +}) + +export const submitMessage = message => ({ + type: 'SUBMIT_MESSAGE', + message +}) + +export const deleteMessages = () => ({ + type: 'DELETE_MESSAGES' }) \ No newline at end of file From 9fd7858e8d8fecfeafe9991fd4caf97a514483b1 Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 10:23:28 -0700 Subject: [PATCH 04/14] Add iteration two --- src/containers/App/App.js | 15 +++++---------- src/containers/ChatBox/ChatBox.js | 3 ++- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/containers/App/App.js b/src/containers/App/App.js index a575506..8e14908 100644 --- a/src/containers/App/App.js +++ b/src/containers/App/App.js @@ -4,21 +4,17 @@ import { bindActionCreators } from 'redux'; import Header from '../Header/Header'; import WelcomeModal from '../WelcomeModal/WelcomeModal'; import ChatBox from '../ChatBox/ChatBox'; -import { removeUser, hasErrored } from '../../actions'; +import { removeUser, hasErrored, submitMessage, deleteMessages } from '../../actions'; import { endConversation } from '../../apiCalls'; import './App.css'; export class App extends Component { constructor() { super(); - this.state = { - messages: [] - } } addMessage = (message, isUser) => { - const { messages } = this.state; - this.setState({ messages: [...messages, { message, isUser }]}); + this.props.submitMessage(message, isUser); } clearMessages = () => { @@ -37,12 +33,11 @@ export class App extends Component { render() { const { user } = this.props; - const { messages } = this.state; return (
- {!user && } - {user && } + {!user && } + {user && }
); } @@ -52,6 +47,6 @@ export const mapStateToProps = ({ user }) => ({ user, }); -export const mapDispatchToProps = dispatch => bindActionCreators({ removeUser, hasErrored }, dispatch); +export const mapDispatchToProps = dispatch => bindActionCreators({ removeUser, hasErrored, submitMessage, deleteMessages }, dispatch); export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/src/containers/ChatBox/ChatBox.js b/src/containers/ChatBox/ChatBox.js index a67bdff..0da1722 100644 --- a/src/containers/ChatBox/ChatBox.js +++ b/src/containers/ChatBox/ChatBox.js @@ -70,7 +70,8 @@ export class ChatBox extends Component { } } -export const mapStateToProps = ({ errorMsg }) => ({ +export const mapStateToProps = ({ messages, errorMsg }) => ({ + messages, errorMsg }) From d149f5078cf925ccac58885f322d78a04a36987b Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 10:24:24 -0700 Subject: [PATCH 05/14] Update snapshots --- src/containers/App/__snapshots__/App.test.js.snap | 2 +- .../WelcomeModal/__snapshots__/WelcomeModal.test.js.snap | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/containers/App/__snapshots__/App.test.js.snap b/src/containers/App/__snapshots__/App.test.js.snap index 2ccf9ae..2635a99 100644 --- a/src/containers/App/__snapshots__/App.test.js.snap +++ b/src/containers/App/__snapshots__/App.test.js.snap @@ -9,7 +9,6 @@ exports[`App component should match the snapshot with a ChatBox if the user has /> `; @@ -23,6 +22,7 @@ exports[`App component should match the snapshot with a WelcomeModal if the user /> `; diff --git a/src/containers/WelcomeModal/__snapshots__/WelcomeModal.test.js.snap b/src/containers/WelcomeModal/__snapshots__/WelcomeModal.test.js.snap index c9b9c77..383af37 100644 --- a/src/containers/WelcomeModal/__snapshots__/WelcomeModal.test.js.snap +++ b/src/containers/WelcomeModal/__snapshots__/WelcomeModal.test.js.snap @@ -61,6 +61,7 @@ exports[`WelcomeModal component should display an error message if not all of th @@ -123,6 +124,7 @@ exports[`WelcomeModal component should match the snapshot if there are no errors From adbc3e345b1f5d090603b8eb80e7628e3d06e75b Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 10:25:45 -0700 Subject: [PATCH 06/14] Add actions testing --- src/actions/index.js | 5 +++-- src/actions/index.test.js | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/actions/index.test.js diff --git a/src/actions/index.js b/src/actions/index.js index 06791be..3ab792b 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -12,9 +12,10 @@ export const hasErrored = errorMsg => ({ errorMsg }) -export const submitMessage = message => ({ +export const submitMessage = (message, isUser) => ({ type: 'SUBMIT_MESSAGE', - message + message, + isUser }) export const deleteMessages = () => ({ diff --git a/src/actions/index.test.js b/src/actions/index.test.js new file mode 100644 index 0000000..2715189 --- /dev/null +++ b/src/actions/index.test.js @@ -0,0 +1,23 @@ +import * as actions from './index'; + +describe('actions testing', () => { + it('should have a type of SUBMIT_MESSAGE', () => { + const message = "HALP"; + const expectedAction = { + type: 'SUBMIT_MESSAGE', + message: "HALP", + isUser: true + }; + const result = actions.submitMessage(message, true); + expect(result).toEqual(expectedAction); + }); + + it('should have a type of DELETE_MESSAGES', () => { + const expectedAction = { + type: 'DELETE_MESSAGES' + }; + const result = actions.deleteMessages(); + expect(result).toEqual(expectedAction); + }); +}); + From b289338b59f1de3110196c16f891f33645e5d5ec Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 10:26:03 -0700 Subject: [PATCH 07/14] Add reducer to rootReducer --- src/reducers/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/reducers/index.js b/src/reducers/index.js index 215afaf..21af33a 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -1,9 +1,11 @@ import { combineReducers } from 'redux'; import { user } from './user'; import { errorMsg } from './errorMsg'; +import { messages } from './messages'; const rootReducer = combineReducers({ user, + messages, errorMsg }); From 59cf0e022cd356c0b79d807e02aac87ec42e8e10 Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 10:37:52 -0700 Subject: [PATCH 08/14] Add testing for messages reducer --- src/reducers/messages.js | 13 +++++++++++++ src/reducers/messages.test.js | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/reducers/messages.js create mode 100644 src/reducers/messages.test.js diff --git a/src/reducers/messages.js b/src/reducers/messages.js new file mode 100644 index 0000000..2c55366 --- /dev/null +++ b/src/reducers/messages.js @@ -0,0 +1,13 @@ +export const messages = (state = [], action) => { + switch(action.type) { + case 'SUBMIT_MESSAGE': + return [...state, { + message: action.message, + isUser: action.isUser + }]; + case 'DELETE_MESSAGES': + return []; + default: + return state; + } +} \ No newline at end of file diff --git a/src/reducers/messages.test.js b/src/reducers/messages.test.js new file mode 100644 index 0000000..456c29a --- /dev/null +++ b/src/reducers/messages.test.js @@ -0,0 +1,36 @@ +import { messages } from './messages'; + +describe('messages reducer', () => { + it('should return the initial state', () => { + const expected = []; + const result = messages(undefined, {}); + expect(result).toEqual(expected); + }); + + it('should return the state when SUBMIT_MESSAGE is the type', () => { + const expected = [{ + message: 'puhlease', + isUser: true + }]; + const mockAction = { + type: 'SUBMIT_MESSAGE', + message: 'puhlease', + isUser: true + }; + const result = messages([], mockAction); + expect(result).toEqual(expected); + }); + + it('should return the state when DELETE_MESSAGES is the type', () => { + const expected = []; + const initialState = [{ + message: 'puhlease', + isUser: true + }]; + const mockAction = { + type: 'DELETE_MESSAGES' + } + const result = messages(initialState, mockAction); + expect(result).toEqual(expected); + }) +}); \ No newline at end of file From f72e0d3cda655a2204f3c27daf12b62eb6679dcd Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 10:52:30 -0700 Subject: [PATCH 09/14] Add app mapDispatch testing --- src/containers/App/App.js | 2 +- src/containers/App/App.test.js | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/containers/App/App.js b/src/containers/App/App.js index 8e14908..5de8404 100644 --- a/src/containers/App/App.js +++ b/src/containers/App/App.js @@ -44,7 +44,7 @@ export class App extends Component { } export const mapStateToProps = ({ user }) => ({ - user, + user }); export const mapDispatchToProps = dispatch => bindActionCreators({ removeUser, hasErrored, submitMessage, deleteMessages }, dispatch); diff --git a/src/containers/App/App.test.js b/src/containers/App/App.test.js index 1e16bb4..5914db6 100644 --- a/src/containers/App/App.test.js +++ b/src/containers/App/App.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { App, mapStateToProps, mapDispatchToProps } from './App'; -import { removeUser, hasErrored } from '../../actions'; +import { removeUser, hasErrored, submitMessage, deleteMessages } from '../../actions'; import { endConversation } from '../../apiCalls'; jest.mock('../../apiCalls'); @@ -9,6 +9,8 @@ jest.mock('../../apiCalls'); describe('App component', () => { const mockRemoveUser = jest.fn(); const mockHasErrored = jest.fn(); + const mocksubmitMessage = jest.fn(); + const mockDeleteMessages = jest.fn(); let wrapper; beforeEach(() => { @@ -23,6 +25,8 @@ describe('App component', () => { user={mockUser} removeUser={mockRemoveUser} hasErrored={mockHasErrored} + submitMessage={mocksubmitMessage} + deletemessages={mockDeleteMessages} />); }); @@ -35,6 +39,8 @@ describe('App component', () => { user={null} removeUser={mockRemoveUser} hasErrored={mockHasErrored} + submitMessage={mocksubmitMessage} + deletemessages={mockDeleteMessages} />); expect(wrapper).toMatchSnapshot(); @@ -106,4 +112,24 @@ describe('mapDispatchToProps', () => { expect(mockDispatch).toHaveBeenCalledWith(actionToDispatch); }); + + it('calls dispatch with a submitMessage action when submitMessage is called', () => { + const mockDispatch = jest.fn(); + const actionToDispatch = submitMessage(); + + const mappedProps = mapDispatchToProps(mockDispatch); + mappedProps.submitMessage(); + + expect(mockDispatch).toHaveBeenCalledWith(actionToDispatch); + }); + + it('calls dispatch with a deleteMessages action when deleteMessages is called', () => { + const mockDispatch = jest.fn(); + const actionToDispatch = deleteMessages(); + + const mappedProps = mapDispatchToProps(mockDispatch); + mappedProps.deleteMessages(); + + expect(mockDispatch).toHaveBeenCalledWith(actionToDispatch); + }); }); From 575b93bfa45a7c1b4759167165ecb2ffe5f051f0 Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 10:55:15 -0700 Subject: [PATCH 10/14] Update chatbox testing --- src/containers/ChatBox/ChatBox.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/containers/ChatBox/ChatBox.test.js b/src/containers/ChatBox/ChatBox.test.js index cdc0e79..e1e83b2 100644 --- a/src/containers/ChatBox/ChatBox.test.js +++ b/src/containers/ChatBox/ChatBox.test.js @@ -133,7 +133,11 @@ describe('mapStateToProps', () => { errorMsg: '' }; const expected = { - errorMsg: '' + errorMsg: '', + messages: [{ + message: 'Hi there, my name is Dr. Watson. I understand that you have been feeling happy. That is super exciting to hear!', + isUser: false, + }] }; const mappedProps = mapStateToProps(mockState); From 2e8599ccbade2083a21b53246291ccf581623c99 Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 11:07:52 -0700 Subject: [PATCH 11/14] Add post fetch for reply from doctor watson --- src/apiCalls.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/apiCalls.js b/src/apiCalls.js index 87e109c..0c23657 100644 --- a/src/apiCalls.js +++ b/src/apiCalls.js @@ -14,12 +14,29 @@ export const startConversation = async feeling => { } const data = await response.json(); - console.log(data) return data; } export const postMessage = async newMessage => { - + const messageInfo = { newMessage }; + + const options = { + method: 'POST', + body: JSON.stringify(messageInfo), + headers: {'Content-Type': 'application/json'} + }; + + const response = await fetch('https://drwatson-api.herokuapp.com/api/message', options); + + if (!response.ok) { + const error = await response.json(); + throw new Error(error.message); + }; + + const reply = await response.json(); + console.log('reply', reply); + + return reply; } export const endConversation = async () => { From 590492eff7897ec03fe60ba3849b7a130fb65ac2 Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 11:42:44 -0700 Subject: [PATCH 12/14] Add testing to api calls --- src/apiCalls.js | 3 +-- src/apiCalls.test.js | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/src/apiCalls.js b/src/apiCalls.js index 0c23657..3b4d8ed 100644 --- a/src/apiCalls.js +++ b/src/apiCalls.js @@ -30,11 +30,10 @@ export const postMessage = async newMessage => { if (!response.ok) { const error = await response.json(); - throw new Error(error.message); + throw new Error('Dr Watson is currently down. Please try again later.'); }; const reply = await response.json(); - console.log('reply', reply); return reply; } diff --git a/src/apiCalls.test.js b/src/apiCalls.test.js index efc3ac4..8116522 100644 --- a/src/apiCalls.test.js +++ b/src/apiCalls.test.js @@ -90,4 +90,56 @@ describe('endConversation', () => { expect(endConversation()).rejects.toEqual(Error('fetch failed.')); }); + + describe('postMessage', () => { + let mockMessage = 'Last hulp'; + let mockResolve = { + newMessage: 'Last hulp' + } + + beforeEach(() => { + window.fetch = jest.fn().mockImplementation(() => { + return Promise.resolve({ + ok: true, + json: () => Promise.resolve(mockResolve) + }); + }); + }); + + it('should fetch with the correct arguments', () => { + const expected = [ 'https://drwatson-api.herokuapp.com/api/message', { + method: 'POST', + body: JSON.stringify(mockResolve), + headers: { + 'Content-Type': 'application/json' + } + }] + postMessage(mockMessage); + + expect(window.fetch).toHaveBeenCalledWith(...expected) + }); + + it('should return a new response message (HAPPY)', () => { + expect(postMessage(mockMessage)).resolves.toEqual(mockResolve); + }); + + it('should return an error (SAD)', () => { + window.fetch = jest.fn().mockImplementation(() => { + return Promise.resolve({ + ok: false, + json: () => Promise.resolve(mockResolve) + }); + }); + + expect(postMessage(mockMessage)).rejects.toEqual(Error('Dr Watson is currently down. Please try again later.')) + }); + + it('should return an error if promise rejects (SAD)', () => { + window.fetch = jest.fn().mockImplementation(() => { + return Promise.reject(Error('fetch failed.')) + }); + + expect(postMessage(mockMessage)).rejects.toEqual(Error('fetch failed.')) + }); + }); }); \ No newline at end of file From 886e9e872c70430225f1fb50427477d64f940186 Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 11:47:25 -0700 Subject: [PATCH 13/14] Refactors to take out console errors --- src/apiCalls.js | 35 +++++++++++++++++------------------ src/containers/App/App.js | 4 ---- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/apiCalls.js b/src/apiCalls.js index 3b4d8ed..d3a7537 100644 --- a/src/apiCalls.js +++ b/src/apiCalls.js @@ -18,24 +18,23 @@ export const startConversation = async feeling => { } export const postMessage = async newMessage => { - const messageInfo = { newMessage }; - - const options = { - method: 'POST', - body: JSON.stringify(messageInfo), - headers: {'Content-Type': 'application/json'} - }; - - const response = await fetch('https://drwatson-api.herokuapp.com/api/message', options); - - if (!response.ok) { - const error = await response.json(); - throw new Error('Dr Watson is currently down. Please try again later.'); - }; - - const reply = await response.json(); - - return reply; + const messageInfo = { newMessage }; + + const options = { + method: 'POST', + body: JSON.stringify(messageInfo), + headers: {'Content-Type': 'application/json'} + }; + + const response = await fetch('https://drwatson-api.herokuapp.com/api/message', options); + + if (!response.ok) { + throw new Error('Dr Watson is currently down. Please try again later.'); + }; + + const reply = await response.json(); + + return reply; } export const endConversation = async () => { diff --git a/src/containers/App/App.js b/src/containers/App/App.js index 5de8404..04b446a 100644 --- a/src/containers/App/App.js +++ b/src/containers/App/App.js @@ -9,10 +9,6 @@ import { endConversation } from '../../apiCalls'; import './App.css'; export class App extends Component { - constructor() { - super(); - } - addMessage = (message, isUser) => { this.props.submitMessage(message, isUser); } From 60ae0eed96625f962d48a82f20db1cb9019977cf Mon Sep 17 00:00:00 2001 From: Ben Firth Date: Wed, 15 Jan 2020 11:52:51 -0700 Subject: [PATCH 14/14] Add robbie background --- src/containers/App/App.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/containers/App/App.css b/src/containers/App/App.css index d890a36..6562b1b 100644 --- a/src/containers/App/App.css +++ b/src/containers/App/App.css @@ -3,7 +3,8 @@ } .App { - background-color: #282c34; + /* background-color: #282c34; */ + background: url('https://ca.slack-edge.com/T029P2S9M-U0S2QJD42-62348d5b08d9-512'); min-height: 100vh; display: flex; flex-direction: column;