GeezerVison is showing github.com — Merge pull request #228 from alibaba/feat/lowcode-slot-props · yaorb/lowcode-engine@6b24f9d
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-renderer/jest.config.js -5Lines changed: 0 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -const esModules = ['@recore/obx-react'].join('|'); | 2 | | - | 3 | 1 | module.exports = { | 4 | 2 | // transform: { | 5 | 3 | // '^.+\\.[jt]sx?$': 'babel-jest', | 6 | 4 | // // '^.+\\.(ts|tsx)$': 'ts-jest', | 7 | 5 | // // '^.+\\.(js|jsx)$': 'babel-jest', | 8 | 6 | // }, | 9 | 7 | // testMatch: ['(/tests?/.*(test))\\.[jt]s$'], | 10 | | - transformIgnorePatterns: [ | 11 | | - `/node_modules/(?!${esModules})/`, | 12 | | - ], | 13 | 8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], | 14 | 9 | collectCoverage: true, | 15 | 10 | collectCoverageFrom: [ | |
Collapse file Copy file name to clipboardExpand all lines: packages/renderer-core/jest.config.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | const esModules = [ | 2 | | - '@recore/obx-react', | 3 | 2 | '@alilc/lowcode-datasource-engine', | 4 | 3 | ].join('|'); | 5 | 4 |
| |
Collapse file Copy file name to clipboard +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +{ | | 2 | + "plugins": [ | | 3 | + "build-plugin-component", | | 4 | + "@alilc/lowcode-test-mate/plugin/index.ts" | | 5 | + ] | | 6 | +} |
Collapse file Copy file name to clipboard +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +module.exports = { | | 2 | + moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], | | 3 | + collectCoverage: true, | | 4 | + collectCoverageFrom: [ | | 5 | + 'src/**/*.{ts,tsx}', | | 6 | + '!**/node_modules/**', | | 7 | + '!**/vendor/**', | | 8 | + ], | | 9 | +}; |
Collapse file Copy file name to clipboardExpand all lines: packages/utils/package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | "main": "lib/index.js", | 10 | 10 | "module": "es/index.js", | 11 | 11 | "scripts": { | | 12 | + "test": "build-scripts test --config build.test.json", | 12 | 13 | "build": "build-scripts build --skip-demo" | 13 | 14 | }, | 14 | 15 | "dependencies": { | |
Collapse file Copy file name to clipboardExpand all lines: packages/utils/src/schema.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,7 +26,7 @@ export function compatibleLegaoSchema(props: any): any { | 26 | 26 | type: 'JSSlot', | 27 | 27 | title: (props.value.props as any)?.slotTitle, | 28 | 28 | name: (props.value.props as any)?.slotName, | 29 | | - value: props.value.children, | | 29 | + value: compatibleLegaoSchema(props.value.children), | 30 | 30 | params: (props.value.props as any)?.slotParams, | 31 | 31 | }; | 32 | 32 | } else { | |
Collapse file Copy file name to clipboard +23Lines changed: 23 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP | | 2 | + | | 3 | +exports[`Schema Ut props 1`] = ` | | 4 | +Object { | | 5 | + "props": Object { | | 6 | + "mobileSlot": Object { | | 7 | + "name": undefined, | | 8 | + "params": undefined, | | 9 | + "title": undefined, | | 10 | + "type": "JSSlot", | | 11 | + "value": Array [ | | 12 | + Object { | | 13 | + "loop": Object { | | 14 | + "mock": undefined, | | 15 | + "type": "JSExpression", | | 16 | + "value": "props.content", | | 17 | + }, | | 18 | + }, | | 19 | + ], | | 20 | + }, | | 21 | + }, | | 22 | +} | | 23 | +`; |
Collapse file Copy file name to clipboard +27Lines changed: 27 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { compatibleLegaoSchema } from '../../src/schema'; | | 2 | +describe('Schema Ut', () => { | | 3 | + it('props', () => { | | 4 | + const schema = { | | 5 | + props: { | | 6 | + mobileSlot: { | | 7 | + type: "JSBlock", | | 8 | + value: { | | 9 | + componentName: "Slot", | | 10 | + children: [ | | 11 | + { | | 12 | + loop: { | | 13 | + variable: "props.content", | | 14 | + type: "variable" | | 15 | + }, | | 16 | + } | | 17 | + ], | | 18 | + } | | 19 | + }, | | 20 | + }, | | 21 | + }; | | 22 | + | | 23 | + const result = compatibleLegaoSchema(schema); | | 24 | + expect(result).toMatchSnapshot(); | | 25 | + expect(result.props.mobileSlot.value[0].loop.type).toBe('JSExpression'); | | 26 | + }); | | 27 | +}) |
|