mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
test: 修改相应单测
This commit is contained in:
parent
05c7b5ad68
commit
70577adc7f
@ -7,7 +7,7 @@ module.exports = {
|
||||
// // '^.+\\.(js|jsx)$': 'babel-jest',
|
||||
// },
|
||||
// testMatch: ['**/project.test.ts'],
|
||||
testMatch: ['(/tests?/.*(test))\\.[jt]s$'],
|
||||
// testMatch: ['(/tests?/.*(test))\\.[jt]s$'],
|
||||
transformIgnorePatterns: [
|
||||
`/node_modules/(?!${esModules})/`,
|
||||
],
|
||||
|
||||
@ -2,7 +2,64 @@
|
||||
|
||||
exports[`document-model 测试 各种方法测试 1`] = `
|
||||
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 [
|
||||
Object {
|
||||
"children": Array [
|
||||
|
||||
@ -161,10 +161,16 @@ describe('document-model 测试', () => {
|
||||
designer.createComponentMeta(divMeta);
|
||||
designer.createComponentMeta(otherMeta);
|
||||
const doc = new DocumentModel(project, formSchema);
|
||||
expect(doc.getComponentsMap(['Other'])).toEqual([
|
||||
{ componentName: 'Div', package: '@ali/vc-div' },
|
||||
{ componentName: 'Other', package: '@ali/vc-other' },
|
||||
]);
|
||||
const comps = doc.getComponentsMap(['Other']);
|
||||
expect(comps.find(comp => comp.componentName === 'Div')).toEqual(
|
||||
{ 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', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user