refactor: 将data-source,dep,schema,utils收敛到core,将form,table,stage,design,util收敛到editor
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
import { describe, expect, test, vi } from 'vitest';
|
||||
import { mount } from '@vue/test-utils';
|
||||
|
||||
import { NodeType } from '@tmagic/schema';
|
||||
import { NodeType } from '@tmagic/core';
|
||||
|
||||
import Stage from '@editor/layouts/workspace/viewer/Stage.vue';
|
||||
|
||||
|
||||
@@ -19,15 +19,15 @@
|
||||
import { beforeAll, describe, expect, test } from 'vitest';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
import type { MApp } from '@tmagic/schema';
|
||||
import { NodeType } from '@tmagic/schema';
|
||||
import type { MApp } from '@tmagic/core';
|
||||
import { NodeType } from '@tmagic/core';
|
||||
|
||||
import editorService from '@editor/services/editor';
|
||||
import historyService from '@editor/services/history';
|
||||
import storageService from '@editor/services/storage';
|
||||
import { COPY_STORAGE_KEY, setConfig } from '@editor/utils';
|
||||
import { COPY_STORAGE_KEY, setEditorConfig } from '@editor/utils';
|
||||
|
||||
setConfig({
|
||||
setEditorConfig({
|
||||
// eslint-disable-next-line no-eval
|
||||
parseDSL: (dsl: string) => eval(dsl),
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, test } from 'vitest';
|
||||
|
||||
import { NodeType } from '@tmagic/schema';
|
||||
import { NodeType } from '@tmagic/core';
|
||||
|
||||
import props from '@editor/services/props';
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
import { describe, expect, test } from 'vitest';
|
||||
|
||||
import { NodeType } from '@tmagic/schema';
|
||||
import { NodeType } from '@tmagic/core';
|
||||
|
||||
import * as editor from '@editor/utils/editor';
|
||||
|
||||
@@ -60,40 +60,6 @@ describe('util form', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('isFixed', () => {
|
||||
test('true', () => {
|
||||
expect(
|
||||
editor.isFixed({
|
||||
type: 'text',
|
||||
id: 1,
|
||||
style: {
|
||||
position: 'fixed',
|
||||
},
|
||||
}),
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test('false', () => {
|
||||
expect(
|
||||
editor.isFixed({
|
||||
type: 'text',
|
||||
id: 1,
|
||||
style: {
|
||||
position: 'absolute',
|
||||
},
|
||||
}),
|
||||
).toBeFalsy();
|
||||
|
||||
expect(
|
||||
editor.isFixed({
|
||||
type: 'text',
|
||||
id: 1,
|
||||
style: {},
|
||||
}),
|
||||
).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('getNodeIndex', () => {
|
||||
test('能获取到', () => {
|
||||
const index = editor.getNodeIndex(1, {
|
||||
|
||||
Reference in New Issue
Block a user