diff --git a/.circleci/config.yml b/.circleci/config.yml
index 9aa8c392ca..b024c82e3f 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -22,10 +22,10 @@ references:
ignore: gh-pages
- dist:
requires:
- - setup
+ - setup
- compile:
requires:
- - setup
+ - setup
- lint:
requires:
- setup
@@ -166,7 +166,7 @@ workflows:
<<: *workflow
triggers:
- schedule:
- cron: "0 0 * * *"
+ cron: '0 0 * * *'
filters:
branches:
only:
diff --git a/.github/workflows/ui-ci.yml b/.github/workflows/ui-ci.yml
new file mode 100644
index 0000000000..4d0ecb7cc9
--- /dev/null
+++ b/.github/workflows/ui-ci.yml
@@ -0,0 +1,31 @@
+name: UI-TEST
+
+on:
+ issue_comment:
+ types: [created]
+
+jobs:
+ ui:
+ runs-on: ubuntu-latest
+ if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/ui')
+ steps:
+ - name: checkout
+ uses: actions/checkout@master
+
+ - name: install
+ run: npm ci
+
+ - name: dist
+ run: npm run dist
+
+ - name: test
+ run: npm run test:image
+
+ - name: VERCEL Now Deployment
+ uses: amondnet/now-deployment@v2.0.3
+ with:
+ zeit-token: ${{ secrets.VERCEL_TOKEN }}
+ now-project-id: ${{ secrets.VERCEL_PROJECT_ID}}
+ now-org-id: ${{ secrets.VERCEL_ORG_ID}}
+ working-directory: ./jest-stare
+ if: failure()
diff --git a/.gitignore b/.gitignore
index bb8d5b7e86..f59fe24f3b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,3 +58,7 @@ site/theme/template/Resources/**/*.jsx
site/theme/template/NotFound.jsx
scripts/previewEditor/index.html
components/version/version.tsx
+
+# Image snapshot diff
+__diff_output__/
+/jest-stare
diff --git a/.jest.image.js b/.jest.image.js
new file mode 100644
index 0000000000..9d5b93df08
--- /dev/null
+++ b/.jest.image.js
@@ -0,0 +1,24 @@
+const { moduleNameMapper, transformIgnorePatterns } = require('./.jest');
+
+// jest config for image snapshots
+module.exports = {
+ setupFiles: ['./tests/setup.js'],
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'md'],
+ moduleNameMapper,
+ transform: {
+ '\\.tsx?$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
+ '\\.js$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
+ '\\.md$': './node_modules/@ant-design/tools/lib/jest/demoPreprocessor',
+ '\\.(jpg|png|gif|svg)$': './node_modules/@ant-design/tools/lib/jest/imagePreprocessor',
+ },
+ testRegex: 'image\\.test\\.js$',
+ testEnvironment: 'node',
+ transformIgnorePatterns,
+ snapshotSerializers: ['enzyme-to-json/serializer'],
+ globals: {
+ 'ts-jest': {
+ tsConfigFile: './tsconfig.test.json',
+ },
+ },
+ reporters: ['default', 'jest-stare'],
+};
diff --git a/.jest.js b/.jest.js
index afcd51ffab..6f712cdf65 100644
--- a/.jest.js
+++ b/.jest.js
@@ -26,7 +26,7 @@ module.exports = {
'^react-dnd-test-backend$': 'react-dnd-test-backend/dist/cjs',
'^react-dnd-test-utils$': 'react-dnd-test-utils/dist/cjs',
},
- testPathIgnorePatterns: ['/node_modules/', 'dekko', 'node'],
+ testPathIgnorePatterns: ['/node_modules/', 'dekko', 'node', 'image.test.js'],
transform: {
'\\.tsx?$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
'\\.js$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
diff --git a/components/grid/__tests__/__image_snapshots__/image-test-js-grid-image-image-test-component-image-screenshot-should-correct-1-snap.png b/components/grid/__tests__/__image_snapshots__/image-test-js-grid-image-image-test-component-image-screenshot-should-correct-1-snap.png
new file mode 100644
index 0000000000..65341e5d00
Binary files /dev/null and b/components/grid/__tests__/__image_snapshots__/image-test-js-grid-image-image-test-component-image-screenshot-should-correct-1-snap.png differ
diff --git a/components/grid/__tests__/image.test.js b/components/grid/__tests__/image.test.js
new file mode 100644
index 0000000000..4c308e158c
--- /dev/null
+++ b/components/grid/__tests__/image.test.js
@@ -0,0 +1,37 @@
+import React from 'react';
+import { Col, Row } from '..';
+import imageTest from '../../../tests/shared/imageTest';
+
+describe('Grid image', () => {
+ imageTest(
+ <>
+