mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-06 18:37:07 +00:00
test: 修改相应单测
This commit is contained in:
parent
05c7b5ad68
commit
70577adc7f
@ -7,7 +7,7 @@ module.exports = {
|
|||||||
// // '^.+\\.(js|jsx)$': 'babel-jest',
|
// // '^.+\\.(js|jsx)$': 'babel-jest',
|
||||||
// },
|
// },
|
||||||
// testMatch: ['**/project.test.ts'],
|
// testMatch: ['**/project.test.ts'],
|
||||||
testMatch: ['(/tests?/.*(test))\\.[jt]s$'],
|
// testMatch: ['(/tests?/.*(test))\\.[jt]s$'],
|
||||||
transformIgnorePatterns: [
|
transformIgnorePatterns: [
|
||||||
`/node_modules/(?!${esModules})/`,
|
`/node_modules/(?!${esModules})/`,
|
||||||
],
|
],
|
||||||
|
|||||||
@ -2,7 +2,64 @@
|
|||||||
|
|
||||||
exports[`document-model 测试 各种方法测试 1`] = `
|
exports[`document-model 测试 各种方法测试 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"componentsMap": Array [],
|
"componentsMap": Array [
|
||||||
|
Object {
|
||||||
|
"componentName": "PageHeader",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "RootHeader",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "TextField",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "Column",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "SelectField",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "ColumnsLayout",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "CardContent",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "Card",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "Button",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "Div",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "Form",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "RootContent",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "RootFooter",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"componentName": "Page",
|
||||||
|
"devMode": "lowcode",
|
||||||
|
},
|
||||||
|
],
|
||||||
"componentsTree": Array [
|
"componentsTree": Array [
|
||||||
Object {
|
Object {
|
||||||
"children": Array [
|
"children": Array [
|
||||||
|
|||||||
@ -161,10 +161,16 @@ describe('document-model 测试', () => {
|
|||||||
designer.createComponentMeta(divMeta);
|
designer.createComponentMeta(divMeta);
|
||||||
designer.createComponentMeta(otherMeta);
|
designer.createComponentMeta(otherMeta);
|
||||||
const doc = new DocumentModel(project, formSchema);
|
const doc = new DocumentModel(project, formSchema);
|
||||||
expect(doc.getComponentsMap(['Other'])).toEqual([
|
const comps = doc.getComponentsMap(['Other']);
|
||||||
{ componentName: 'Div', package: '@ali/vc-div' },
|
expect(comps.find(comp => comp.componentName === 'Div')).toEqual(
|
||||||
{ componentName: 'Other', package: '@ali/vc-other' },
|
{ componentName: 'Div', package: '@ali/vc-div' }
|
||||||
]);
|
);
|
||||||
|
expect(comps.find(comp => comp.componentName === 'Other')).toEqual(
|
||||||
|
{ componentName: 'Other', package: '@ali/vc-other' }
|
||||||
|
);
|
||||||
|
expect(comps.find(comp => comp.componentName === 'Page')).toEqual(
|
||||||
|
{ componentName: 'Page', devMode: 'lowcode' }
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('acceptRootNodeVisitor / getRootNodeVisitor', () => {
|
it('acceptRootNodeVisitor / getRootNodeVisitor', () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user