From e8600b2c0dccbed1ae0dc4719fec63596b49a9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 26 Jul 2017 13:50:49 +0100 Subject: [PATCH] test(ui-toolkit): unit tests --- packages/cp-frontend/package.json | 22 +- .../normalized-styled-components/package.json | 14 +- .../test/__snapshots__/index.js.snap | 209 +-- .../test/index.js | 80 +- packages/styled-is/package.json | 2 +- .../.snapguidist/__snapshots__/Anchor-0.snap | 6 + .../.snapguidist/__snapshots__/Anchor-1.snap | 13 + .../__snapshots__/Baseline-1.snap | 24 + .../__snapshots__/Breadcrumb-0.snap | 42 + .../.snapguidist/__snapshots__/Button-1.snap | 16 + .../.snapguidist/__snapshots__/Button-3.snap | 16 + .../.snapguidist/__snapshots__/Button-5.snap | 16 + .../.snapguidist/__snapshots__/Button-7.snap | 18 + .../.snapguidist/__snapshots__/Card-0.snap | 62 + .../.snapguidist/__snapshots__/Card-10.snap | 173 +++ .../.snapguidist/__snapshots__/Card-2.snap | 62 + .../.snapguidist/__snapshots__/Card-4.snap | 85 ++ .../.snapguidist/__snapshots__/Card-6.snap | 61 + .../.snapguidist/__snapshots__/Card-8.snap | 62 + .../__snapshots__/Checkbox-0.snap | 23 + .../__snapshots__/Checkbox-10.snap | 104 ++ .../__snapshots__/Checkbox-12.snap | 104 ++ .../__snapshots__/Checkbox-14.snap | 27 + .../__snapshots__/Checkbox-16.snap | 85 ++ .../__snapshots__/Checkbox-2.snap | 24 + .../__snapshots__/Checkbox-4.snap | 24 + .../__snapshots__/Checkbox-6.snap | 23 + .../__snapshots__/Checkbox-8.snap | 104 ++ .../__snapshots__/CloseButton-0.snap | 19 + .../__snapshots__/Dropdown-0.snap | 54 + .../.snapguidist/__snapshots__/Header-0.snap | 26 + .../__snapshots__/IconButton-0.snap | 19 + .../.snapguidist/__snapshots__/Input-0.snap | 6 + .../.snapguidist/__snapshots__/Input-10.snap | 21 + .../.snapguidist/__snapshots__/Input-2.snap | 21 + .../.snapguidist/__snapshots__/Input-4.snap | 80 ++ .../.snapguidist/__snapshots__/Input-6.snap | 80 ++ .../.snapguidist/__snapshots__/Input-8.snap | 80 ++ .../__snapshots__/ProgressBar-0.snap | 93 ++ .../.snapguidist/__snapshots__/Radio-0.snap | 78 ++ .../.snapguidist/__snapshots__/Radio-10.snap | 69 + .../.snapguidist/__snapshots__/Radio-2.snap | 68 + .../.snapguidist/__snapshots__/Radio-4.snap | 272 ++++ .../.snapguidist/__snapshots__/Radio-6.snap | 272 ++++ .../.snapguidist/__snapshots__/Radio-8.snap | 272 ++++ .../__snapshots__/SectionList-0.snap | 47 + .../.snapguidist/__snapshots__/Select-0.snap | 30 + .../.snapguidist/__snapshots__/Select-10.snap | 124 ++ .../.snapguidist/__snapshots__/Select-12.snap | 124 ++ .../.snapguidist/__snapshots__/Select-14.snap | 124 ++ .../.snapguidist/__snapshots__/Select-16.snap | 32 + .../.snapguidist/__snapshots__/Select-2.snap | 23 + .../.snapguidist/__snapshots__/Select-4.snap | 35 + .../.snapguidist/__snapshots__/Select-6.snap | 34 + .../.snapguidist/__snapshots__/Select-8.snap | 29 + .../.snapguidist/__snapshots__/Theme-0.snap | 1227 +++++++++++++++++ .../.snapguidist/__snapshots__/Toggle-0.snap | 71 + .../.snapguidist/__snapshots__/Toggle-2.snap | 71 + .../.snapguidist/__snapshots__/Toggle-4.snap | 52 + .../.snapguidist/__snapshots__/Toggle-6.snap | 74 + .../.snapguidist/__snapshots__/Tooltip-0.snap | 42 + packages/ui-toolkit/package.json | 40 +- packages/ui-toolkit/src/basealign/index.js | 5 +- packages/ui-toolkit/src/baseline/index.js | 4 +- packages/ui-toolkit/src/button/index.js | 2 +- packages/ui-toolkit/src/card/info.js | 2 +- packages/ui-toolkit/src/card/meta.js | 1 - packages/ui-toolkit/src/card/title.js | 6 +- packages/ui-toolkit/src/close-button/index.js | 3 +- packages/ui-toolkit/src/dropdown/index.js | 8 +- packages/ui-toolkit/src/form/base/input.js | 7 +- packages/ui-toolkit/src/form/number-input.js | 6 +- packages/ui-toolkit/src/icon-button/index.js | 2 +- packages/ui-toolkit/src/icons/minus.js | 2 +- packages/ui-toolkit/src/icons/plus.js | 2 +- packages/ui-toolkit/src/modal/index.js | 3 +- packages/ui-toolkit/src/progress-bar/index.js | 1 - .../ui-toolkit/src/progress-bar/indicator.js | 2 +- packages/ui-toolkit/src/section-list/usage.md | 26 +- .../ui-toolkit/src/status-loader/index.js | 15 +- packages/ui-toolkit/src/theme/colors.js | 9 +- packages/ui-toolkit/src/tooltip/tooltip.js | 3 +- packages/ui-toolkit/src/topology/functions.js | 46 +- packages/ui-toolkit/src/topology/index.js | 228 +-- .../ui-toolkit/src/topology/node/button.js | 10 +- .../ui-toolkit/src/topology/node/content.js | 35 +- .../ui-toolkit/src/topology/node/index.js | 49 +- packages/ui-toolkit/src/topology/node/info.js | 37 +- .../ui-toolkit/src/topology/node/shapes.js | 2 +- .../ui-toolkit/src/topology/node/title.js | 3 +- .../ui-toolkit/src/topology/simulation.js | 11 +- packages/ui-toolkit/styleguide.config.js | 6 +- yarn.lock | 332 +++-- 93 files changed, 5570 insertions(+), 508 deletions(-) create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Anchor-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Anchor-1.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Baseline-1.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Breadcrumb-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Button-1.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Button-3.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Button-5.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Button-7.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Card-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Card-10.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Card-2.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Card-4.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Card-6.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Card-8.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Checkbox-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Checkbox-10.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Checkbox-12.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Checkbox-14.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Checkbox-16.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Checkbox-2.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Checkbox-4.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Checkbox-6.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Checkbox-8.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/CloseButton-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Dropdown-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Header-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/IconButton-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Input-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Input-10.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Input-2.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Input-4.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Input-6.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Input-8.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/ProgressBar-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Radio-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Radio-10.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Radio-2.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Radio-4.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Radio-6.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Radio-8.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/SectionList-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Select-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Select-10.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Select-12.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Select-14.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Select-16.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Select-2.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Select-4.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Select-6.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Select-8.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Theme-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Toggle-0.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Toggle-2.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Toggle-4.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Toggle-6.snap create mode 100644 packages/ui-toolkit/.snapguidist/__snapshots__/Tooltip-0.snap diff --git a/packages/cp-frontend/package.json b/packages/cp-frontend/package.json index 852275d0..91320367 100644 --- a/packages/cp-frontend/package.json +++ b/packages/cp-frontend/package.json @@ -41,17 +41,17 @@ "react-dom": "^15.6.1", "react-redux": "^5.0.5", "react-router": "^4.1.1", - "react-router-dom": "^4.1.1", + "react-router-dom": "^4.1.2", "react-simple-table": "^1.0.1", - "react-styled-flexboxgrid": "^2.0.1", - "redux": "^3.6.0", + "react-styled-flexboxgrid": "^2.0.3", + "redux": "^3.7.2", "redux-actions": "^2.0.3", "redux-batched-actions": "^0.2.0", - "redux-form": "^7.0.0", + "redux-form": "^7.0.2", "remcalc": "^1.0.8", "reselect": "^3.0.1", "simple-statistics": "^4.1.0", - "styled-components": "^2.1.0", + "styled-components": "^2.1.1", "styled-is": "^1.0.11", "styled-text-spinners": "^1.0.1", "title-case": "^2.1.1", @@ -62,7 +62,7 @@ "apr-for-each": "^1.0.6", "apr-main": "^1.0.7", "babel-plugin-inline-react-svg": "^0.4.0", - "babel-plugin-styled-components": "^1.1.4", + "babel-plugin-styled-components": "^1.1.7", "babel-preset-joyent-portal": "^1.0.3", "cross-env": "^5.0.1", "eslint": "^3.19.0", @@ -74,14 +74,14 @@ "jest-junit": "^1.5.1", "jest-matcher-utils": "^20.0.3", "jest-snapshot": "^20.0.3", - "jest-styled-components": "^3.0.2", + "jest-styled-components": "^4.2.2", "mz": "^2.6.0", "react-scripts": "^1.0.7", "react-test-renderer": "^15.6.1", "redrun": "^5.9.15", - "stylelint": "^7.11.1", - "stylelint-config-primer": "^1.4.0", - "stylelint-config-standard": "^16.0.0", - "stylelint-processor-styled-components": "styled-components/stylelint-processor-styled-components#68b4c4f" + "stylelint": "^8.0.0", + "stylelint-config-primer": "^2.0.0", + "stylelint-config-standard": "^17.0.0", + "stylelint-processor-styled-components": "styled-components/stylelint-processor-styled-components#2a33b5f" } } diff --git a/packages/normalized-styled-components/package.json b/packages/normalized-styled-components/package.json index 4f8f7262..00e12f9b 100644 --- a/packages/normalized-styled-components/package.json +++ b/packages/normalized-styled-components/package.json @@ -33,7 +33,7 @@ "remcalc": "^1.0.8" }, "devDependencies": { - "babel-plugin-styled-components": "^1.1.4", + "babel-plugin-styled-components": "^1.1.7", "babel-preset-react-app": "^3.0.0", "bup": "^1.0.9", "chalk": "^1.1.3", @@ -44,17 +44,17 @@ "jest-junit": "^1.5.1", "jest-matcher-utils": "^20.0.3", "jest-snapshot": "^20.0.3", - "jest-styled-components": "^3.0.2", + "jest-styled-components": "^4.2.2", "react": "^15.6.1", "react-scripts": "^1.0.7", "react-test-renderer": "^15.6.1", "redrun": "^5.9.15", "strip-ansi": "^3.0.1", - "styled-components": "^2.1.0", - "stylelint": "^7.11.1", - "stylelint-config-primer": "^1.4.0", - "stylelint-config-standard": "^16.0.0", - "stylelint-processor-styled-components": "styled-components/stylelint-processor-styled-components#68b4c4f" + "styled-components": "^2.1.1", + "stylelint": "^8.0.0", + "stylelint-config-primer": "^2.0.0", + "stylelint-config-standard": "^17.0.0", + "stylelint-processor-styled-components": "styled-components/stylelint-processor-styled-components#2a33b5f" }, "peerDependencies": { "react": "*", diff --git a/packages/normalized-styled-components/test/__snapshots__/index.js.snap b/packages/normalized-styled-components/test/__snapshots__/index.js.snap index 4b08ff09..2348ebdc 100644 --- a/packages/normalized-styled-components/test/__snapshots__/index.js.snap +++ b/packages/normalized-styled-components/test/__snapshots__/index.js.snap @@ -1,71 +1,75 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders correctly 1`] = ` -.jleQxG { +.c0 { background-color: transparent; text-decoration-skip: objects; } `; exports[`renders correctly 1`] = ` - +.c0[title] { + border-bottom: none; + text-decoration: underline; + text-decoration: underline dotted; +} `; exports[`renders
correctly 1`] = ` -.fpcbkF { +.c0 { display: block; }
`; exports[`renders