mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 10:38:16 +08:00
解决大部分用例问题
This commit is contained in:
parent
406793434b
commit
5f077fc31c
5
__mocks__/svgJsMock.js
Normal file
5
__mocks__/svgJsMock.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
const React = require('react');
|
||||||
|
|
||||||
|
exports['default'] = React.forwardRef((props, ref) =>
|
||||||
|
React.createElement('icon-mock', {ref, ...props})
|
||||||
|
);
|
38
package.json
38
package.json
@ -8,7 +8,8 @@
|
|||||||
"start": "concurrently --restart-tries -1 npm:serve npm:dev",
|
"start": "concurrently --restart-tries -1 npm:serve npm:dev",
|
||||||
"stop": "fis3 server stop",
|
"stop": "fis3 server stop",
|
||||||
"dev": "fis3 release -cwd ./public",
|
"dev": "fis3 release -cwd ./public",
|
||||||
"deploy-gh-page": "sh ./deploy-gh-pages.sh"
|
"deploy-gh-page": "sh ./deploy-gh-pages.sh",
|
||||||
|
"test": "npm test --workspaces"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"fis-optimizer-terser": "^1.0.1",
|
"fis-optimizer-terser": "^1.0.1",
|
||||||
@ -25,5 +26,40 @@
|
|||||||
"fis3-prepackager-stand-alone-pack": "^1.0.0",
|
"fis3-prepackager-stand-alone-pack": "^1.0.0",
|
||||||
"fis3-preprocessor-js-require-css": "^0.1.3",
|
"fis3-preprocessor-js-require-css": "^0.1.3",
|
||||||
"fis3-preprocessor-js-require-file": "^0.1.3"
|
"fis3-preprocessor-js-require-file": "^0.1.3"
|
||||||
|
},
|
||||||
|
"jest": {
|
||||||
|
"testEnvironment": "jsdom",
|
||||||
|
"collectCoverageFrom": [
|
||||||
|
"src/**/*"
|
||||||
|
],
|
||||||
|
"moduleFileExtensions": [
|
||||||
|
"ts",
|
||||||
|
"tsx",
|
||||||
|
"js"
|
||||||
|
],
|
||||||
|
"transform": {
|
||||||
|
"\\.(ts|tsx)$": "ts-jest"
|
||||||
|
},
|
||||||
|
"setupFiles": [
|
||||||
|
"jest-canvas-mock"
|
||||||
|
],
|
||||||
|
"testRegex": "/.*\\.test\\.(ts|tsx|js)$",
|
||||||
|
"moduleNameMapper": {
|
||||||
|
"\\.(css|less|sass|scss)$": "<rootDir>/__mocks__/styleMock.js",
|
||||||
|
"\\.(svg)$": "<rootDir>/__mocks__/svgMock.js",
|
||||||
|
"\\.svg\\.js$": "<rootDir>/__mocks__/svgJsMock.js"
|
||||||
|
},
|
||||||
|
"setupFilesAfterEnv": [
|
||||||
|
"<rootDir>/packages/amis-core/__tests__/jest.setup.js"
|
||||||
|
],
|
||||||
|
"testPathIgnorePatterns": [
|
||||||
|
"/node_modules/",
|
||||||
|
"/.rollup.cache/"
|
||||||
|
],
|
||||||
|
"globals": {
|
||||||
|
"ts-jest": {
|
||||||
|
"diagnostics": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,13 @@ const moment = require('moment');
|
|||||||
moment.tz.setDefault('Asia/Shanghai');
|
moment.tz.setDefault('Asia/Shanghai');
|
||||||
const cleanup = require('@testing-library/react').cleanup;
|
const cleanup = require('@testing-library/react').cleanup;
|
||||||
|
|
||||||
|
// https://github.com/nrwl/nx/issues/1178
|
||||||
|
// 解决jest 运行的时候报:
|
||||||
|
// ReferenceError: DragEvent is not defined
|
||||||
|
Object.defineProperty(window, 'DragEvent', {
|
||||||
|
value: class DragEvent {}
|
||||||
|
});
|
||||||
|
|
||||||
global.beforeAll(() => {
|
global.beforeAll(() => {
|
||||||
console.warn = msg => {
|
console.warn = msg => {
|
||||||
// warning 先关了,实在太吵。
|
// warning 先关了,实在太吵。
|
||||||
|
@ -77,11 +77,11 @@
|
|||||||
],
|
],
|
||||||
"testRegex": "/.*\\.test\\.(ts|tsx|js)$",
|
"testRegex": "/.*\\.test\\.(ts|tsx|js)$",
|
||||||
"moduleNameMapper": {
|
"moduleNameMapper": {
|
||||||
"\\.(css|less|sass|scss)$": "<rootDir>/../__mocks__/styleMock.js",
|
"\\.(css|less|sass|scss)$": "<rootDir>/../../__mocks__/styleMock.js",
|
||||||
"\\.(svg)$": "<rootDir>/../__mocks__/svgMock.js"
|
"\\.(svg)$": "<rootDir>/../../__mocks__/svgMock.js"
|
||||||
},
|
},
|
||||||
"setupFilesAfterEnv": [
|
"setupFilesAfterEnv": [
|
||||||
"<rootDir>/__tests__/jest.setup.js"
|
"<rootDir>/../amis-core/__tests__/jest.setup.js"
|
||||||
],
|
],
|
||||||
"testPathIgnorePatterns": [
|
"testPathIgnorePatterns": [
|
||||||
"/node_modules/",
|
"/node_modules/",
|
||||||
@ -89,35 +89,7 @@
|
|||||||
],
|
],
|
||||||
"globals": {
|
"globals": {
|
||||||
"ts-jest": {
|
"ts-jest": {
|
||||||
"diagnostics": false,
|
"diagnostics": false
|
||||||
"tsconfig": {
|
|
||||||
"module": "commonjs",
|
|
||||||
"target": "es5",
|
|
||||||
"lib": [
|
|
||||||
"es6",
|
|
||||||
"dom",
|
|
||||||
"ES2015"
|
|
||||||
],
|
|
||||||
"sourceMap": true,
|
|
||||||
"jsx": "react",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"rootDir": ".",
|
|
||||||
"importHelpers": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"sourceRoot": ".",
|
|
||||||
"noImplicitReturns": true,
|
|
||||||
"noImplicitThis": true,
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"strictNullChecks": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"emitDecoratorMetadata": false,
|
|
||||||
"typeRoots": [
|
|
||||||
"./node_modules/@types",
|
|
||||||
"./types"
|
|
||||||
],
|
|
||||||
"skipLibCheck": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,7 @@ export {
|
|||||||
updateEnv,
|
updateEnv,
|
||||||
Renderer,
|
Renderer,
|
||||||
RendererProps,
|
RendererProps,
|
||||||
|
RenderOptions,
|
||||||
RendererEnv,
|
RendererEnv,
|
||||||
EnvContext,
|
EnvContext,
|
||||||
RegisterStore,
|
RegisterStore,
|
||||||
|
@ -89,35 +89,7 @@
|
|||||||
],
|
],
|
||||||
"globals": {
|
"globals": {
|
||||||
"ts-jest": {
|
"ts-jest": {
|
||||||
"diagnostics": false,
|
"diagnostics": false
|
||||||
"tsconfig": {
|
|
||||||
"module": "commonjs",
|
|
||||||
"target": "es5",
|
|
||||||
"lib": [
|
|
||||||
"es6",
|
|
||||||
"dom",
|
|
||||||
"ES2015"
|
|
||||||
],
|
|
||||||
"sourceMap": true,
|
|
||||||
"jsx": "react",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"rootDir": ".",
|
|
||||||
"importHelpers": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"sourceRoot": ".",
|
|
||||||
"noImplicitReturns": true,
|
|
||||||
"noImplicitThis": true,
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"strictNullChecks": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"emitDecoratorMetadata": false,
|
|
||||||
"typeRoots": [
|
|
||||||
"./node_modules/@types",
|
|
||||||
"./types"
|
|
||||||
],
|
|
||||||
"skipLibCheck": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,643 +0,0 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`factory custom not found 2! 1`] = `
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
Not Found
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`factory custom not found 3! 1`] = `
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
Not Found
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`factory custom not found! 1`] = `
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
Not Found
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`factory load Renderer on need 1`] = `
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
This is Custom Renderer2, a is
|
|
||||||
23
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`factory unregistered Renderer 1`] = `
|
|
||||||
<div>
|
|
||||||
<div
|
|
||||||
class="cxd-Alert cxd-Alert--danger"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Alert-content"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Alert-desc"
|
|
||||||
>
|
|
||||||
<p>
|
|
||||||
Error: 找不到对应的渲染器
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Path:
|
|
||||||
my-renderer
|
|
||||||
</p>
|
|
||||||
<pre>
|
|
||||||
<code>
|
|
||||||
{
|
|
||||||
"type": "my-renderer",
|
|
||||||
"a": 23
|
|
||||||
}
|
|
||||||
</code>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`factory:definitions 1`] = `
|
|
||||||
<div>
|
|
||||||
<div
|
|
||||||
class="cxd-Page"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Page-content"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Page-main"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Page-header"
|
|
||||||
>
|
|
||||||
<h2
|
|
||||||
class="cxd-Page-title"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
引用
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Page-body"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Panel cxd-Panel--default cxd-Panel--form"
|
|
||||||
style="position: relative;"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Panel-heading"
|
|
||||||
>
|
|
||||||
<h3
|
|
||||||
class="cxd-Panel-title"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
表单
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Panel-body"
|
|
||||||
>
|
|
||||||
<form
|
|
||||||
class="cxd-Form cxd-Form--normal"
|
|
||||||
novalidate=""
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
style="display: none;"
|
|
||||||
type="submit"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-item cxd-Form-item--normal"
|
|
||||||
data-role="form-item"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="cxd-Form-label"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
text2
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-control cxd-TextControl"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-TextControl-input"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
autocomplete="off"
|
|
||||||
class=""
|
|
||||||
name="ref1"
|
|
||||||
placeholder=""
|
|
||||||
size="10"
|
|
||||||
type="text"
|
|
||||||
value="ref value"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Remark cxd-Form-remark"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-Remark-icon"
|
|
||||||
>
|
|
||||||
<icon-mock
|
|
||||||
classname=" icon-warning-mark"
|
|
||||||
icon="warning-mark"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-item cxd-Form-item--normal"
|
|
||||||
data-role="form-item"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="cxd-Form-label"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
combo
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="cxd-ComboControl cxd-Form-control"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Combo cxd-Combo--multi cxd-Combo--ver"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Combo-items"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Combo-item"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Combo-itemInner"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Form cxd-Form--normal cxd-Combo-form"
|
|
||||||
novalidate=""
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
style="display: none;"
|
|
||||||
type="submit"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-item cxd-Form-item--normal"
|
|
||||||
data-role="form-item"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="cxd-Form-label"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
combo 1
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-control cxd-TextControl"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-TextControl-input"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
autocomplete="off"
|
|
||||||
class=""
|
|
||||||
name="key"
|
|
||||||
placeholder=""
|
|
||||||
size="10"
|
|
||||||
type="text"
|
|
||||||
value=""
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-item cxd-Form-item--normal"
|
|
||||||
data-role="form-item"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="cxd-Form-label"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
combo 2
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-control cxd-TextControl"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-TextControl-input"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
autocomplete="off"
|
|
||||||
class=""
|
|
||||||
name="value"
|
|
||||||
placeholder=""
|
|
||||||
size="10"
|
|
||||||
type="text"
|
|
||||||
value="ref value"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Remark cxd-Form-remark"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-Remark-icon"
|
|
||||||
>
|
|
||||||
<icon-mock
|
|
||||||
classname=" icon-warning-mark"
|
|
||||||
icon="warning-mark"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-item cxd-Form-item--normal"
|
|
||||||
data-role="form-item"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="cxd-Form-label"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
children
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="cxd-Remark cxd-Form-remark"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-Remark-icon"
|
|
||||||
>
|
|
||||||
<icon-mock
|
|
||||||
classname=" icon-warning-mark"
|
|
||||||
icon="warning-mark"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a
|
|
||||||
class="cxd-Combo-delBtn "
|
|
||||||
data-position="bottom"
|
|
||||||
data-tooltip="删除"
|
|
||||||
>
|
|
||||||
<icon-mock
|
|
||||||
classname="icon icon-status-close"
|
|
||||||
icon="status-close"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Combo-toolbar"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
class="cxd-Button cxd-Button--default cxd-Combo-addBtn"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<icon-mock
|
|
||||||
classname="icon icon-plus"
|
|
||||||
icon="plus"
|
|
||||||
/>
|
|
||||||
<span>
|
|
||||||
新增
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Remark cxd-Form-remark"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-Remark-icon"
|
|
||||||
>
|
|
||||||
<icon-mock
|
|
||||||
classname=" icon-warning-mark"
|
|
||||||
icon="warning-mark"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="resize-sensor"
|
|
||||||
style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: scroll; z-index: -1; visibility: hidden;"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="resize-sensor-expand"
|
|
||||||
style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
style="position: absolute; left: 0px; top: 0px; width: 10px; height: 10px;"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="resize-sensor-shrink"
|
|
||||||
style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
style="position: absolute; left: 0; top: 0; width: 200%; height: 200%"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="resize-sensor-appear"
|
|
||||||
style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;animation-name: apearSensor; animation-duration: 0.2s;"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`factory:definitions override 1`] = `
|
|
||||||
<div>
|
|
||||||
<div
|
|
||||||
class="cxd-Page"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Page-content"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Page-main"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Page-header"
|
|
||||||
>
|
|
||||||
<h2
|
|
||||||
class="cxd-Page-title"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
引用
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Page-body"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Panel cxd-Panel--default cxd-Panel--form"
|
|
||||||
style="position: relative;"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-Panel-heading"
|
|
||||||
>
|
|
||||||
<h3
|
|
||||||
class="cxd-Panel-title"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
表单
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Panel-body"
|
|
||||||
>
|
|
||||||
<form
|
|
||||||
class="cxd-Form cxd-Form--normal"
|
|
||||||
novalidate=""
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
style="display: none;"
|
|
||||||
type="submit"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-item cxd-Form-item--normal"
|
|
||||||
data-role="form-item"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="cxd-Form-label"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
text2
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-control cxd-TextControl"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="cxd-TextControl-input"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
autocomplete="off"
|
|
||||||
class=""
|
|
||||||
name="ref1"
|
|
||||||
placeholder=""
|
|
||||||
size="10"
|
|
||||||
type="text"
|
|
||||||
value=""
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Remark cxd-Form-remark"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-Remark-icon"
|
|
||||||
>
|
|
||||||
<icon-mock
|
|
||||||
classname=" icon-warning-mark"
|
|
||||||
icon="warning-mark"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Form-item cxd-Form-item--normal"
|
|
||||||
data-role="form-item"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="cxd-Form-label"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<span
|
|
||||||
class="cxd-TplField"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
combo
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
class="cxd-CheckboxesControl cxd-Form-control is-inline"
|
|
||||||
>
|
|
||||||
<label
|
|
||||||
class="cxd-Checkbox cxd-Checkbox--checkbox cxd-Checkbox--full"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
checked=""
|
|
||||||
type="checkbox"
|
|
||||||
/>
|
|
||||||
<i />
|
|
||||||
<span
|
|
||||||
class=""
|
|
||||||
>
|
|
||||||
Option A
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<label
|
|
||||||
class="cxd-Checkbox cxd-Checkbox--checkbox cxd-Checkbox--full"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
/>
|
|
||||||
<i />
|
|
||||||
<span
|
|
||||||
class=""
|
|
||||||
>
|
|
||||||
Option B
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="cxd-Remark cxd-Form-remark"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="cxd-Remark-icon"
|
|
||||||
>
|
|
||||||
<icon-mock
|
|
||||||
classname=" icon-warning-mark"
|
|
||||||
icon="warning-mark"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="resize-sensor"
|
|
||||||
style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: scroll; z-index: -1; visibility: hidden;"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="resize-sensor-expand"
|
|
||||||
style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
style="position: absolute; left: 0px; top: 0px; width: 10px; height: 10px;"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="resize-sensor-shrink"
|
|
||||||
style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
style="position: absolute; left: 0; top: 0; width: 200%; height: 200%"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="resize-sensor-appear"
|
|
||||||
style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;animation-name: apearSensor; animation-duration: 0.2s;"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`factory:registerRenderer 1`] = `
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
This is Custom Renderer, a is
|
|
||||||
23
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import NotFound from '../../../amis-ui/src/components/404';
|
import {NotFound} from 'amis-ui';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render, fireEvent, cleanup} from '@testing-library/react';
|
import {render, fireEvent, cleanup} from '@testing-library/react';
|
||||||
|
|
||||||
afterEach(cleanup);
|
afterEach(cleanup);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv, wait} from '../helper';
|
import {makeEnv, wait} from '../helper';
|
||||||
|
|
||||||
test('EventAction:ajax', async () => {
|
test('EventAction:ajax', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('EventAction:copy', async () => {
|
test('EventAction:copy', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('EventAction:custom', async () => {
|
test('EventAction:custom', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv, wait} from '../helper';
|
import {makeEnv, wait} from '../helper';
|
||||||
|
|
||||||
test('EventAction:dialog', async () => {
|
test('EventAction:dialog', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render} from '@testing-library/react';
|
import {fireEvent, render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('EventAction:disabled', async () => {
|
test('EventAction:disabled', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv, wait} from '../helper';
|
import {makeEnv, wait} from '../helper';
|
||||||
|
|
||||||
test('EventAction:drawer', async () => {
|
test('EventAction:drawer', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('EventAction:email', async () => {
|
test('EventAction:email', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render} from '@testing-library/react';
|
import {fireEvent, render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('EventAction:hidden', async () => {
|
test('EventAction:hidden', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('EventAction:prevent', async () => {
|
test('EventAction:prevent', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('EventAction:action', async () => {
|
test('EventAction:action', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('EventAction:toast', async () => {
|
test('EventAction:toast', async () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fireEvent, render, waitFor} from '@testing-library/react';
|
import {fireEvent, render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('EventAction:url & link', async () => {
|
test('EventAction:url & link', async () => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {waitFor} from '@testing-library/react';
|
import {waitFor} from '@testing-library/react';
|
||||||
import {RenderOptions} from '../src/factory';
|
import {RenderOptions} from '../src';
|
||||||
|
|
||||||
// jest.useFakeTimers 会修改 global 的 setTimeout 所以需要把原始的记录下来。
|
// jest.useFakeTimers 会修改 global 的 setTimeout 所以需要把原始的记录下来。
|
||||||
const timerFn = (global as any).originSetTimeout || setTimeout;
|
const timerFn = (global as any).originSetTimeout || setTimeout;
|
||||||
|
@ -8,9 +8,9 @@ import {
|
|||||||
screen,
|
screen,
|
||||||
waitFor
|
waitFor
|
||||||
} from '@testing-library/react';
|
} from '@testing-library/react';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv, wait} from '../helper';
|
import {makeEnv, wait} from '../helper';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
|
|
||||||
afterEach(cleanup);
|
afterEach(cleanup);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:alert', () => {
|
test('Renderer:alert', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:anchorNav', () => {
|
test('Renderer:anchorNav', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:avatar test', () => {
|
test('Renderer:avatar test', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, waitFor} from '@testing-library/react';
|
import {render, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv, wait} from '../helper';
|
import {makeEnv, wait} from '../helper';
|
||||||
import 'jest-canvas-mock';
|
import 'jest-canvas-mock';
|
||||||
|
|
||||||
@ -19,7 +19,9 @@ test('Renderer:bar-code', async () => {
|
|||||||
makeEnv({})
|
makeEnv({})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await waitFor(() => expect(container.querySelector('.cxd-BarCode')).toBeInTheDocument());
|
await waitFor(() =>
|
||||||
|
expect(container.querySelector('.cxd-BarCode')).toBeInTheDocument()
|
||||||
|
);
|
||||||
|
|
||||||
expect(container).toMatchSnapshot();
|
expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {fireEvent, render, screen} from '@testing-library/react';
|
import {fireEvent, render, screen} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:button-toolbar', async () => {
|
test('Renderer:button-toolbar', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, waitFor} from '@testing-library/react';
|
import {render, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv, wait} from '../helper';
|
import {makeEnv, wait} from '../helper';
|
||||||
import rows from '../mockData/rows';
|
import rows from '../mockData/rows';
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:card', () => {
|
test('Renderer:card', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, waitFor} from '@testing-library/react';
|
import {render, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv, wait} from '../helper';
|
import {makeEnv, wait} from '../helper';
|
||||||
|
|
||||||
test('Renderer:carousel', async () => {
|
test('Renderer:carousel', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:container', () => {
|
test('Renderer:container', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:custom', () => {
|
test('Renderer:custom', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent} from '@testing-library/react';
|
import {render, fireEvent} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:dropdown-button', async () => {
|
test('Renderer:dropdown-button', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:each', async () => {
|
test('Renderer:each', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:flex', () => {
|
test('Renderer:flex', () => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup} from '@testing-library/react';
|
import {render, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent} from '@testing-library/react';
|
import {render, cleanup, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {wait, makeEnv} from '../../helper';
|
import {wait, makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent} from '@testing-library/react';
|
import {render, cleanup, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, waitForElementToBeRemoved} from '@testing-library/react';
|
import {render, waitForElementToBeRemoved} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:chained-select', async () => {
|
test('Renderer:chained-select', async () => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent} from '@testing-library/react';
|
import {render, cleanup, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent} from '@testing-library/react';
|
import {render, cleanup, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, waitFor} from '@testing-library/react';
|
import {render, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:city', async () => {
|
test('Renderer:city', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent} from '@testing-library/react';
|
import {render, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:color', async () => {
|
test('Renderer:color', async () => {
|
||||||
|
@ -6,8 +6,8 @@ import {
|
|||||||
waitFor,
|
waitFor,
|
||||||
act
|
act
|
||||||
} from '@testing-library/react';
|
} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:combo', () => {
|
test('Renderer:combo', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {fireEvent, render, screen} from '@testing-library/react';
|
import {fireEvent, render, screen} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
const testSchema = {
|
const testSchema = {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent} from '@testing-library/react';
|
import {render, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:container', async () => {
|
test('Renderer:container', async () => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -2,8 +2,8 @@ import React = require('react');
|
|||||||
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ import React = require('react');
|
|||||||
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent} from '@testing-library/react';
|
import {render, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:fieldSet', async () => {
|
test('Renderer:fieldSet', async () => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, cleanup} from '@testing-library/react';
|
import {render, fireEvent, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {wait, makeEnv} from '../../helper';
|
import {wait, makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, waitFor} from '@testing-library/react';
|
import {render, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:formula', async () => {
|
test('Renderer:formula', async () => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup} from '@testing-library/react';
|
import {render, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup} from '@testing-library/react';
|
import {render, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup} from '@testing-library/react';
|
import {render, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {fireEvent, render} from '@testing-library/react';
|
import {fireEvent, render} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender, setIconVendor} from '../../../src/index';
|
import {render as amisRender, setIconVendor} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:icon-picker', async () => {
|
test('Renderer:icon-picker', async () => {
|
||||||
|
@ -8,10 +8,10 @@ import {
|
|||||||
getByText,
|
getByText,
|
||||||
waitFor
|
waitFor
|
||||||
} from '@testing-library/react';
|
} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {wait, makeEnv} from '../../helper';
|
import {wait, makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
import {createMemoryHistory} from 'history';
|
import {createMemoryHistory} from 'history';
|
||||||
|
|
||||||
// mock getComputedStyle
|
// mock getComputedStyle
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
@ -180,7 +180,7 @@ test('Form:initData:remote', async () => {
|
|||||||
{
|
{
|
||||||
type: 'text',
|
type: 'text',
|
||||||
name: 'a',
|
name: 'a',
|
||||||
label: 'Label',
|
label: 'Label'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, cleanup, screen} from '@testing-library/react';
|
import {render, fireEvent, cleanup, screen} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:inputArray', async () => {
|
test('Renderer:inputArray', async () => {
|
||||||
|
@ -2,8 +2,8 @@ import React = require('react');
|
|||||||
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {fireEvent, render, screen} from '@testing-library/react';
|
import {fireEvent, render, screen} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:input-formula', async () => {
|
test('Renderer:input-formula', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent} from '@testing-library/react';
|
import {render, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:fieldSet', async () => {
|
test('Renderer:fieldSet', async () => {
|
||||||
|
@ -2,8 +2,8 @@ import React = require('react');
|
|||||||
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
import {render, fireEvent, waitFor, getByText} from '@testing-library/react';
|
import {render, fireEvent, waitFor, getByText} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, within, cleanup} from '@testing-library/react';
|
import {render, fireEvent, within, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, screen, fireEvent} from '@testing-library/react';
|
import {render, screen, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:input table', () => {
|
test('Renderer:input table', () => {
|
||||||
|
@ -2,8 +2,8 @@ import React = require('react');
|
|||||||
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ import React = require('react');
|
|||||||
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
import {render, fireEvent, screen, within} from '@testing-library/react';
|
import {render, fireEvent, screen, within} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, screen} from '@testing-library/react';
|
import {render, fireEvent, screen} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {createMockMediaMatcher, makeEnv, wait} from '../../helper';
|
import {createMockMediaMatcher, makeEnv, wait} from '../../helper';
|
||||||
import {act} from 'react-dom/test-utils';
|
import {act} from 'react-dom/test-utils';
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent} from '@testing-library/react';
|
import {render, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {createMockMediaMatcher, makeEnv} from '../../helper';
|
import {createMockMediaMatcher, makeEnv} from '../../helper';
|
||||||
|
|
||||||
let originalMatchMedia: any;
|
let originalMatchMedia: any;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, screen} from '@testing-library/react';
|
import {render, fireEvent, screen} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
|
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {createMockMediaMatcher, makeEnv} from '../../helper';
|
import {createMockMediaMatcher, makeEnv} from '../../helper';
|
||||||
|
|
||||||
let originalMatchMedia: any;
|
let originalMatchMedia: any;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent} from '@testing-library/react';
|
import {render, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:number', async () => {
|
test('Renderer:number', async () => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent} from '@testing-library/react';
|
import {render, cleanup, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup} from '@testing-library/react';
|
import {render, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent} from '@testing-library/react';
|
import {render, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:range', async () => {
|
test('Renderer:range', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:rating', async () => {
|
test('Renderer:rating', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent} from '@testing-library/react';
|
import {render, fireEvent} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:repeat', async () => {
|
test('Renderer:repeat', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, screen, fireEvent, waitFor} from '@testing-library/react';
|
import {render, screen, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:select menutpl', () => {
|
test('Renderer:select menutpl', () => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup} from '@testing-library/react';
|
import {render, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup} from '@testing-library/react';
|
import {render, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup} from '@testing-library/react';
|
import {render, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:tabs-transfer', () => {
|
test('Renderer:tabs-transfer', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, cleanup, screen} from '@testing-library/react';
|
import {render, fireEvent, cleanup, screen} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:TabsTransferPicker', async () => {
|
test('Renderer:TabsTransferPicker', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, fireEvent, waitFor} from '@testing-library/react';
|
import {render, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:textarea', async () => {
|
test('Renderer:textarea', async () => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
import {clearStoresCache} from '../../../src/factory';
|
import {clearStoresCache} from 'amis';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -2,8 +2,8 @@ import React = require('react');
|
|||||||
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
import PageRenderer from '../../../../amis-core/src/renderers/Form';
|
||||||
import * as renderer from 'react-test-renderer';
|
import * as renderer from 'react-test-renderer';
|
||||||
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
import {render, fireEvent, cleanup, getByText} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:time', async () => {
|
test('Renderer:time', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:transfer', () => {
|
test('Renderer:transfer', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render, cleanup} from '@testing-library/react';
|
import {render, cleanup} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv} from '../../helper';
|
import {makeEnv} from '../../helper';
|
||||||
|
|
||||||
test('Renderer:usersselect', async () => {
|
test('Renderer:usersselect', async () => {
|
||||||
|
@ -6,8 +6,8 @@ import {
|
|||||||
getByText,
|
getByText,
|
||||||
waitFor
|
waitFor
|
||||||
} from '@testing-library/react';
|
} from '@testing-library/react';
|
||||||
import '../../../src/themes/default';
|
import '../../../src';
|
||||||
import {render as amisRender} from '../../../src/index';
|
import {render as amisRender} from '../../../src';
|
||||||
import {makeEnv, wait} from '../../helper';
|
import {makeEnv, wait} from '../../helper';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:grid2d', () => {
|
test('Renderer:grid2d', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:gridnav', () => {
|
test('Renderer:gridnav', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:hbox', async () => {
|
test('Renderer:hbox', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:iframe', async () => {
|
test('Renderer:iframe', async () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React = require('react');
|
import React = require('react');
|
||||||
import {render} from '@testing-library/react';
|
import {render} from '@testing-library/react';
|
||||||
import '../../src/themes/default';
|
import '../../src';
|
||||||
import {render as amisRender} from '../../src/index';
|
import {render as amisRender} from '../../src';
|
||||||
import {makeEnv} from '../helper';
|
import {makeEnv} from '../helper';
|
||||||
|
|
||||||
test('Renderer:image', async () => {
|
test('Renderer:image', async () => {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user