diff --git a/.circleci/config.yml b/.circleci/config.yml index 57becee8577..b509fa09e79 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,6 +71,10 @@ jobs: name: Build the portal, just to test if the build is successful command: yarn build-ci + - run: + name: Run screenshot tests + command: test-ci-screenshots + deploy-release: docker: - image: circleci/node:10.6 @@ -109,6 +113,10 @@ jobs: name: Build the portal command: yarn build-ci + - run: + name: Run screenshot tests + command: test-ci-screenshots + - run: name: Deploy the portal command: yarn deploy-ci diff --git a/.drone.yml b/.drone.yml index f2d263db443..acea1323c3b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -47,6 +47,7 @@ steps: - yarn test-ci - yarn prepublish-ci - yarn build-ci + - yarn test-ci-screenshots when: event: - push @@ -80,6 +81,7 @@ steps: - yarn test-ci - yarn prepublish-ci - yarn build-ci + - yarn test-ci-screenshots - yarn deploy-ci - yarn publish-ci when: diff --git a/.travis.yml b/.travis.yml index 248e4b0fb4a..a25c2239c90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,11 +31,11 @@ jobs: - stage: deploy-preview name: Build a portal preview - script: yarn audit-ci && yarn lint-ci && yarn test-ci && yarn prepublish-ci && yarn build-ci + script: yarn audit-ci && yarn lint-ci && yarn test-ci && yarn prepublish-ci && yarn build-ci && test-ci-screenshots - stage: deploy-release name: Deploy portal and make eventually NPM release - script: yarn audit-ci && yarn lint-ci && yarn test-ci && yarn prepublish-ci && yarn build-ci && yarn deploy-ci && yarn publish-ci + script: yarn audit-ci && yarn lint-ci && yarn test-ci && yarn prepublish-ci && yarn build-ci && test-ci-screenshots && yarn deploy-ci && yarn publish-ci stages: - name: test diff --git a/package.json b/package.json index 2ea9f59ca2f..f655d48373a 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "test": "yarn workspace dnb-ui-lib test", "test:update": "yarn workspace dnb-ui-lib test:update", "test-ci": "yarn workspace dnb-ui-lib test-ci && yarn workspace dnb-design-system-portal test-ci", - "test-ci:update": "yarn test-ci --updateSnapshot" + "test-ci-screenshots": "yarn workspace dnb-ui-lib test-ci-screenshots" }, "devDependencies": { "husky": "^1.3.1" diff --git a/packages/dnb-design-system-portal/package.json b/packages/dnb-design-system-portal/package.json index 30b98858f3b..92895077761 100644 --- a/packages/dnb-design-system-portal/package.json +++ b/packages/dnb-design-system-portal/package.json @@ -34,7 +34,7 @@ "start": "rm -rf .cache | cross-env DEBUG=gatsby:query-watcher gatsby develop", "test": "jest --watch", "test-ci": "jest --ci", - "test:staged": "jest --bail --findRelatedTests :#keep this whitespace", + "test:staged": "jest --bail --findRelatedTests ", "test:update": "jest --updateSnapshot", "prettier:components": "prettier --loglevel warn --write './src/uilib/{components,patterns}/**/*.{js,md}' './src/pages/uilib/{components,elements,patterns}/*.{js,md}'", "prettier:diff": "prettier --list-different '{scripts,stories,src}/**/*.{js,md}'", @@ -71,7 +71,7 @@ "del": "^3.0.0", "emotion": "^10.0.7", "enzyme": "^3.8.0", - "enzyme-adapter-react-16": "^1.9.0", + "enzyme-adapter-react-16": "^1.9.1", "enzyme-to-json": "^3.3.5", "eslint": "^5.13.0", "eslint-plugin-import": "^2.16.0", @@ -79,7 +79,7 @@ "eslint-plugin-react": "^7.12.4", "front-matter": "^3.0.1", "fs-extra": "^7.0.1", - "gatsby": "^2.0.114", + "gatsby": "^2.0.115", "gatsby-link": "^2.0.10", "gatsby-mdx": "^0.3.5", "gatsby-plugin-catch-links": "^2.0.10", @@ -93,7 +93,7 @@ "gatsby-remark-images": "^3.0.3", "gatsby-source-filesystem": "^2.0.20", "gh-pages": "^2.0.1", - "jest": "^23.6.0", + "jest": "^24.1.0", "jest-css-modules": "^1.1.0", "jest-emotion": "^10.0.7", "jest-raw-loader": "^1.0.1", @@ -112,7 +112,7 @@ "react-fake-props": "^0.3.1", "react-helmet": "^5.2.0", "react-live": "^1.12.0", - "react-live-replacement": "https://github.com/tujoworker/react-live/", + "react-live-replacement": "https://github.com/tujoworker/react-live/tarball/d9a44a8b8093a3cb57734d901200f7b66cd30515", "stylelint": "^9.10.1", "stylelint-config-styled-components": "^0.1.1", "stylelint-processor-styled-components": "^1.5.2" diff --git a/packages/dnb-design-system-portal/src/core/jest/jestSetup.js b/packages/dnb-design-system-portal/src/core/jest/jestSetup.js index 745f51a0c7a..8613e2322c9 100644 --- a/packages/dnb-design-system-portal/src/core/jest/jestSetup.js +++ b/packages/dnb-design-system-portal/src/core/jest/jestSetup.js @@ -3,7 +3,6 @@ * */ -// import '@babel/polyfill' // jest v24 may have usage of this import { createSerializer } from 'jest-emotion' import fakeProps from 'react-fake-props' import { mount, render, shallow } from './enzyme' diff --git a/packages/dnb-design-system-portal/src/pages/uilib/components/button/Examples.js b/packages/dnb-design-system-portal/src/pages/uilib/components/button/Examples.js index f48eab4a902..54043590878 100644 --- a/packages/dnb-design-system-portal/src/pages/uilib/components/button/Examples.js +++ b/packages/dnb-design-system-portal/src/pages/uilib/components/button/Examples.js @@ -86,7 +86,6 @@ class Example extends PureComponent { {/* @jsx */ ` -<>