, container);
+
+ divRef.current.dispatchEvent(
+ new MouseEvent('mouseout', {
+ bubbles: true,
+ cancelable: true,
+ relatedTarget: otherDivRef.current,
+ }),
+ );
+
+ expect(onMouseEnter).toHaveBeenCalledTimes(1);
+ });
+});
+
+
diff --git a/scripts/__tests__/EventTest/MouseEvent.test.js b/scripts/__tests__/EventTest/MouseEvent.test.js
index 62abb34c..46cc6522 100644
--- a/scripts/__tests__/EventTest/MouseEvent.test.js
+++ b/scripts/__tests__/EventTest/MouseEvent.test.js
@@ -13,7 +13,7 @@
* See the Mulan PSL v2 for more details.
*/
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../libs/inula/index';
import { getLogUtils } from '../jest/testUtils';
describe('MouseEvent Test', () => {
@@ -21,7 +21,7 @@ describe('MouseEvent Test', () => {
describe('onClick Test', () => {
it('绑定this', () => {
- class App extends Horizon.Component {
+ class App extends Inula.Component {
constructor(props) {
super(props);
this.state = {
@@ -52,7 +52,7 @@ describe('MouseEvent Test', () => {
}
}
- Horizon.render(
, container);
expect(container.querySelector('p').innerHTML).toBe('0');
expect(container.querySelector('#p').innerHTML).toBe('100');
// 点击按钮触发num加1
@@ -65,7 +65,7 @@ describe('MouseEvent Test', () => {
it('点击触发', () => {
const handleClick = jest.fn();
- Horizon.render(
, container);
container.querySelector('button').click();
expect(handleClick).toHaveBeenCalledTimes(1);
for (let i = 0; i < 5; i++) {
@@ -76,8 +76,8 @@ describe('MouseEvent Test', () => {
it('disable不触发click', () => {
const handleClick = jest.fn();
- const spanRef = Horizon.createRef();
- Horizon.render(
+ const spanRef = Inula.createRef();
+ Inula.render(
,
@@ -90,7 +90,7 @@ describe('MouseEvent Test', () => {
});
const test = (name, config) => {
- const node = Horizon.render(config, container);
+ const node = Inula.render(config, container);
let event = new MouseEvent(name, {
relatedTarget: null,
bubbles: true,
@@ -163,7 +163,7 @@ describe('MouseEvent Test', () => {
});
it('KeyboardEvent.getModifierState should not fail', () => {
- const input = Horizon.render(
{
e.getModifierState('CapsLock');
}}
diff --git a/scripts/__tests__/EventTest/WheelEvent.test.js b/scripts/__tests__/EventTest/WheelEvent.test.js
index e563d94c..13f8bada 100644
--- a/scripts/__tests__/EventTest/WheelEvent.test.js
+++ b/scripts/__tests__/EventTest/WheelEvent.test.js
@@ -13,14 +13,14 @@
* See the Mulan PSL v2 for more details.
*/
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../libs/inula/index';
import { getLogUtils } from '../jest/testUtils';
describe('合成滚轮事件', () => {
const LogUtils = getLogUtils();
it('onWheel', () => {
- const realNode = Horizon.render(
+ const realNode = Inula.render(
LogUtils.log(`onWheel: ${event.type}`)}
onWheelCapture={event => LogUtils.log(`onWheelCapture: ${event.type}`)}
@@ -50,7 +50,7 @@ describe('合成滚轮事件', () => {
expect(e.isPropagationStopped()).toBe(true);
LogUtils.log(e.type + ' handle');
};
- const realNode = Horizon.render(
+ const realNode = Inula.render(
,
container
);
diff --git a/scripts/__tests__/HorizonIsTest/index.test.js b/scripts/__tests__/HorizonIsTest/index.test.js
deleted file mode 100644
index ff33477d..00000000
--- a/scripts/__tests__/HorizonIsTest/index.test.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2020 Huawei Technologies Co.,Ltd.
- *
- * InulaJS is licensed under Mulan PSL v2.
- * You can use this software according to the terms and conditions of the Mulan PSL v2.
- * You may obtain a copy of Mulan PSL v2 at:
- *
- * http://license.coscl.org.cn/MulanPSL2
- *
- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
- * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
- * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
- * See the Mulan PSL v2 for more details.
- */
-
-import * as Horizon from '@cloudsop/horizon/index.ts';
-
-function App() {
- return <>>;
-}
-
-describe('HorizonIs', () => {
- it('should identify horizon elements', () => {
- expect(Horizon.isElement(
)).toBe(true);
- expect(Horizon.isElement('span')).toBe(false);
- expect(Horizon.isElement(111)).toBe(false);
- expect(Horizon.isElement(false)).toBe(false);
- expect(Horizon.isElement(null)).toBe(false);
- expect(Horizon.isElement([])).toBe(false);
- expect(Horizon.isElement({})).toBe(false);
- expect(Horizon.isElement(undefined)).toBe(false);
-
- const TestContext = Horizon.createContext(false);
- expect(Horizon.isElement(
)).toBe(true);
- expect(Horizon.isElement(
)).toBe(true);
- expect(Horizon.isElement(<>>)).toBe(true);
- expect(Horizon.isElement(
)).toBe(true);
- });
-
- it('should identify Fragment', () => {
- expect(Horizon.isFragment(<>>)).toBe(true);
- });
-
- it('should identify memo component', () => {
- const MemoComp = Horizon.memo(App);
- expect(Horizon.isMemo(
)).toBe(true);
- });
-
- it('should identify forwardRef', () => {
- const ForwardRefComp = Horizon.forwardRef(App);
- expect(Horizon.isForwardRef(
)).toBe(true);
- });
-
- it('should identify lazy', () => {
- const LazyComp = Horizon.lazy(() => App);
- expect(Horizon.isLazy(
)).toBe(true);
- });
-
- it('should identify portal', () => {
- const portal = Horizon.createPortal(
, container);
- expect(Horizon.isPortal(portal)).toBe(true);
- });
-
- it('should identify ContextProvider', () => {
- const TestContext = Horizon.createContext(false);
- expect(Horizon.isContextProvider(
)).toBe(true);
- expect(Horizon.isContextProvider(
)).toBe(false);
- expect(Horizon.isContextConsumer(
)).toBe(false);
- expect(Horizon.isContextConsumer(
)).toBe(true);
- });
-});
diff --git a/scripts/__tests__/HorizonXText/StateManager/StateArray.test.tsx b/scripts/__tests__/HorizonXTest/StateManager/StateArray.test.tsx
similarity index 94%
rename from scripts/__tests__/HorizonXText/StateManager/StateArray.test.tsx
rename to scripts/__tests__/HorizonXTest/StateManager/StateArray.test.tsx
index 9ffad653..ca4a9e08 100644
--- a/scripts/__tests__/HorizonXText/StateManager/StateArray.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StateManager/StateArray.test.tsx
@@ -14,9 +14,9 @@
*/
//@ts-ignore
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../../libs/inula/index';
import * as LogUtils from '../../jest/logUtils';
-import { clearStore, createStore, useStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import { clearStore, createStore, useStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
import { App, Text, triggerClickEvent } from '../../jest/commonComponents';
import { describe, beforeEach, afterEach, it, expect } from '@jest/globals';
@@ -49,7 +49,7 @@ const useUserStore = createStore({
});
describe('测试store中的Array', () => {
- const { unmountComponentAtNode } = Horizon;
+ const { unmountComponentAtNode } = Inula;
let container: HTMLElement | null = null;
beforeEach(() => {
// 创建一个 DOM 元素作为渲染目标
@@ -102,17 +102,17 @@ describe('测试store中的Array', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: 2');
// 在Array中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: 3');
// 在Array中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: 2');
@@ -138,7 +138,7 @@ describe('测试store中的Array', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// push
@@ -188,7 +188,7 @@ describe('测试store中的Array', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// push
diff --git a/scripts/__tests__/HorizonXText/StateManager/StateMap.test.tsx b/scripts/__tests__/HorizonXTest/StateManager/StateMap.test.tsx
similarity index 88%
rename from scripts/__tests__/HorizonXText/StateManager/StateMap.test.tsx
rename to scripts/__tests__/HorizonXTest/StateManager/StateMap.test.tsx
index f327b09c..ddbf7589 100644
--- a/scripts/__tests__/HorizonXText/StateManager/StateMap.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StateManager/StateMap.test.tsx
@@ -14,9 +14,9 @@
*/
//@ts-ignore
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../../libs/inula/index';
import * as LogUtils from '../../jest/logUtils';
-import { clearStore, createStore, useStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import { clearStore, createStore, useStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
import { App, Text, triggerClickEvent } from '../../jest/commonComponents';
import { describe, beforeEach, afterEach, it, expect } from '@jest/globals';
@@ -49,7 +49,7 @@ const useUserStore = createStore({
});
describe('测试store中的Map', () => {
- const { unmountComponentAtNode } = Horizon;
+ const { unmountComponentAtNode } = Inula;
let container: HTMLElement | null = null;
beforeEach(() => {
// 创建一个 DOM 元素作为渲染目标
@@ -73,13 +73,13 @@ describe('测试store中的Map', () => {
function Parent(props) {
const userStore = useUserStore();
- const addOnePerson = function() {
+ const addOnePerson = function () {
userStore.addOnePerson(newPerson);
};
- const delOnePerson = function() {
+ const delOnePerson = function () {
userStore.delOnePerson(newPerson);
};
- const clearPersons = function() {
+ const clearPersons = function () {
userStore.clearPersons();
};
@@ -110,23 +110,23 @@ describe('测试store中的Map', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#size')?.innerHTML).toBe('persons number: 2');
// 在Map中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#size')?.innerHTML).toBe('persons number: 3');
// 在Map中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#size')?.innerHTML).toBe('persons number: 2');
// clear Map
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#size')?.innerHTML).toBe('persons number: 0');
@@ -149,23 +149,23 @@ describe('测试store中的Map', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// 在Map中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2 p3');
// 在Map中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// clear Map
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: ');
@@ -188,23 +188,23 @@ describe('测试store中的Map', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#ageList')?.innerHTML).toBe('age list: 1 2');
// 在Map中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#ageList')?.innerHTML).toBe('age list: 1 2 3');
// 在Map中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#ageList')?.innerHTML).toBe('age list: 1 2');
// clear Map
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#ageList')?.innerHTML).toBe('age list: ');
@@ -227,23 +227,23 @@ describe('测试store中的Map', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// 在Map中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2 p3');
// 在Map中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// clear Map
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: ');
@@ -265,23 +265,23 @@ describe('测试store中的Map', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// 在Map中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2 p3');
// 在Map中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// clear Map
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: ');
@@ -298,11 +298,11 @@ describe('测试store中的Map', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: false');
// 在Map中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: true');
@@ -324,23 +324,23 @@ describe('测试store中的Map', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// 在Map中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2 p3');
// 在Map中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// clear Map
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: ');
diff --git a/scripts/__tests__/HorizonXText/StateManager/StateMixType.test.tsx b/scripts/__tests__/HorizonXTest/StateManager/StateMixType.test.tsx
similarity index 93%
rename from scripts/__tests__/HorizonXText/StateManager/StateMixType.test.tsx
rename to scripts/__tests__/HorizonXTest/StateManager/StateMixType.test.tsx
index 2bb360af..52e9b610 100644
--- a/scripts/__tests__/HorizonXText/StateManager/StateMixType.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StateManager/StateMixType.test.tsx
@@ -14,13 +14,13 @@
*/
//@ts-ignore
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../../libs/inula/index';
import * as LogUtils from '../../jest/logUtils';
-import { clearStore, createStore, useStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import { clearStore, createStore, useStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
import { App, Text, triggerClickEvent } from '../../jest/commonComponents';
describe('测试store中的混合类型变化', () => {
- const { unmountComponentAtNode } = Horizon;
+ const { unmountComponentAtNode } = Inula;
let container: HTMLElement | null = null;
beforeEach(() => {
// 创建一个 DOM 元素作为渲染目标
@@ -98,10 +98,10 @@ describe('测试store中的混合类型变化', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#dayList')?.innerHTML).toBe('love: 1 3 5');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#dayList')?.innerHTML).toBe('love: 1 3 5 7');
@@ -168,7 +168,7 @@ describe('测试store中的混合类型变化', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('p1 p2');
diff --git a/scripts/__tests__/HorizonXText/StateManager/StateSet.test.tsx b/scripts/__tests__/HorizonXTest/StateManager/StateSet.test.tsx
similarity index 90%
rename from scripts/__tests__/HorizonXText/StateManager/StateSet.test.tsx
rename to scripts/__tests__/HorizonXTest/StateManager/StateSet.test.tsx
index 7c1c8656..84213b7d 100644
--- a/scripts/__tests__/HorizonXText/StateManager/StateSet.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StateManager/StateSet.test.tsx
@@ -14,9 +14,9 @@
*/
//@ts-ignore
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../../libs/inula/index';
import * as LogUtils from '../../jest/logUtils';
-import { clearStore, createStore, useStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import { clearStore, createStore, useStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
import { App, Text, triggerClickEvent } from '../../jest/commonComponents';
import { describe, beforeEach, afterEach, it, expect } from '@jest/globals';
@@ -49,7 +49,7 @@ const useUserStore = createStore({
});
describe('测试store中的Set', () => {
- const { unmountComponentAtNode } = Horizon;
+ const { unmountComponentAtNode } = Inula;
let container: HTMLElement | null = null;
beforeEach(() => {
// 创建一个 DOM 元素作为渲染目标
@@ -116,24 +116,24 @@ describe('测试store中的Set', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#size')?.innerHTML).toBe('persons number: 2');
expect(container?.querySelector('#lastAge')?.innerHTML).toBe('last person age: 2');
// 在set中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#size')?.innerHTML).toBe('persons number: 3');
// 在set中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#size')?.innerHTML).toBe('persons number: 2');
// clear set
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#size')?.innerHTML).toBe('persons number: 0');
@@ -158,23 +158,23 @@ describe('测试store中的Set', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// 在set中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2 p3');
// 在set中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// clear set
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: ');
@@ -197,23 +197,23 @@ describe('测试store中的Set', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// 在set中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2 p3');
// 在set中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// clear set
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: ');
@@ -235,23 +235,23 @@ describe('测试store中的Set', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// 在set中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2 p3');
// 在set中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// clear set
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: ');
@@ -268,11 +268,11 @@ describe('测试store中的Set', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: false');
// 在set中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: true');
@@ -294,23 +294,23 @@ describe('测试store中的Set', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// 在set中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2 p3');
// 在set中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: p1 p2');
// clear set
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'clearBtn');
});
expect(container?.querySelector('#nameList')?.innerHTML).toBe('name list: ');
diff --git a/scripts/__tests__/HorizonXText/StateManager/StateWeakMap.test.tsx b/scripts/__tests__/HorizonXTest/StateManager/StateWeakMap.test.tsx
similarity index 91%
rename from scripts/__tests__/HorizonXText/StateManager/StateWeakMap.test.tsx
rename to scripts/__tests__/HorizonXTest/StateManager/StateWeakMap.test.tsx
index c6e2fc09..9e847d18 100644
--- a/scripts/__tests__/HorizonXText/StateManager/StateWeakMap.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StateManager/StateWeakMap.test.tsx
@@ -14,9 +14,9 @@
*/
//@ts-ignore
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../../libs/inula/index';
import * as LogUtils from '../../jest/logUtils';
-import { clearStore, createStore, useStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import { clearStore, createStore, useStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
import { App, Text, triggerClickEvent } from '../../jest/commonComponents';
import { describe, beforeEach, afterEach, it, expect } from '@jest/globals';
@@ -49,7 +49,7 @@ const useUserStore = createStore({
});
describe('测试store中的WeakMap', () => {
- const { unmountComponentAtNode } = Horizon;
+ const { unmountComponentAtNode } = Inula;
let container: HTMLElement | null = null;
beforeEach(() => {
// 创建一个 DOM 元素作为渲染目标
@@ -110,17 +110,17 @@ describe('测试store中的WeakMap', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: false');
// 在WeakMap中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: true');
// 在WeakMap中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: false');
@@ -137,11 +137,11 @@ describe('测试store中的WeakMap', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: undefined');
// 在WeakMap中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: 3');
diff --git a/scripts/__tests__/HorizonXText/StateManager/StateWeakSet.test.tsx b/scripts/__tests__/HorizonXTest/StateManager/StateWeakSet.test.tsx
similarity index 92%
rename from scripts/__tests__/HorizonXText/StateManager/StateWeakSet.test.tsx
rename to scripts/__tests__/HorizonXTest/StateManager/StateWeakSet.test.tsx
index 962e73c3..9986b941 100644
--- a/scripts/__tests__/HorizonXText/StateManager/StateWeakSet.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StateManager/StateWeakSet.test.tsx
@@ -14,9 +14,9 @@
*/
//@ts-ignore
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../../libs/inula/index';
import * as LogUtils from '../../jest/logUtils';
-import { clearStore, createStore, useStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import { clearStore, createStore, useStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
import { App, Text, triggerClickEvent } from '../../jest/commonComponents';
import { describe, beforeEach, afterEach, it, expect } from '@jest/globals';
@@ -49,7 +49,7 @@ const useUserStore = createStore({
});
describe('测试store中的WeakSet', () => {
- const { unmountComponentAtNode } = Horizon;
+ const { unmountComponentAtNode } = Inula;
let container: HTMLElement | null = null;
beforeEach(() => {
// 创建一个 DOM 元素作为渲染目标
@@ -102,17 +102,17 @@ describe('测试store中的WeakSet', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: false');
// 在WeakSet中增加一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'addBtn');
});
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: true');
// 在WeakSet中删除一个对象
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, 'delBtn');
});
expect(container?.querySelector('#hasPerson')?.innerHTML).toBe('has new person: false');
diff --git a/scripts/__tests__/HorizonXText/StoreFunctionality/async.test.tsx b/scripts/__tests__/HorizonXTest/StoreFunctionality/async.test.tsx
similarity index 93%
rename from scripts/__tests__/HorizonXText/StoreFunctionality/async.test.tsx
rename to scripts/__tests__/HorizonXTest/StoreFunctionality/async.test.tsx
index a215e3be..da9e1ca6 100644
--- a/scripts/__tests__/HorizonXText/StoreFunctionality/async.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StoreFunctionality/async.test.tsx
@@ -14,12 +14,12 @@
*/
//@ts-ignore
-import * as Horizon from '../../../../libs/horizon';
-import { createStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import * as Inula from '../../../../libs/inula/index';
+import { createStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
import { triggerClickEvent } from '../../jest/commonComponents';
import { describe, beforeEach, afterEach, it, expect } from '@jest/globals';
-const { unmountComponentAtNode } = Horizon;
+const { unmountComponentAtNode } = Inula;
function postpone(timer, func) {
return new Promise(resolve => {
diff --git a/scripts/__tests__/HorizonXText/StoreFunctionality/basicAccess.test.tsx b/scripts/__tests__/HorizonXTest/StoreFunctionality/basicAccess.test.tsx
similarity index 89%
rename from scripts/__tests__/HorizonXText/StoreFunctionality/basicAccess.test.tsx
rename to scripts/__tests__/HorizonXTest/StoreFunctionality/basicAccess.test.tsx
index a626551b..277a5bad 100644
--- a/scripts/__tests__/HorizonXText/StoreFunctionality/basicAccess.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StoreFunctionality/basicAccess.test.tsx
@@ -14,13 +14,13 @@
*/
//@ts-ignore
-import Horizon from '@cloudsop/horizon/index.ts';
+import Inula from '../../../../libs/inula/index';
import { triggerClickEvent } from '../../jest/commonComponents';
import { useLogStore } from './store';
import { describe, beforeEach, afterEach, it, expect } from '@jest/globals';
-import { createStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import { createStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
-const { unmountComponentAtNode } = Horizon;
+const { unmountComponentAtNode } = Inula;
describe('Basic store manipulation', () => {
let container: HTMLElement | null = null;
@@ -46,7 +46,7 @@ describe('Basic store manipulation', () => {
return
{logStore.length}
;
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(document.getElementById(RESULT_ID)?.innerHTML).toBe('1');
});
@@ -70,9 +70,9 @@ describe('Basic store manipulation', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
@@ -98,9 +98,9 @@ describe('Basic store manipulation', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
@@ -142,9 +142,9 @@ describe('Basic store manipulation', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
@@ -187,9 +187,9 @@ describe('Basic store manipulation', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
diff --git a/scripts/__tests__/HorizonXText/StoreFunctionality/cloneDeep.test.js b/scripts/__tests__/HorizonXTest/StoreFunctionality/cloneDeep.test.js
similarity index 81%
rename from scripts/__tests__/HorizonXText/StoreFunctionality/cloneDeep.test.js
rename to scripts/__tests__/HorizonXTest/StoreFunctionality/cloneDeep.test.js
index d2b159d8..e1c0231d 100644
--- a/scripts/__tests__/HorizonXText/StoreFunctionality/cloneDeep.test.js
+++ b/scripts/__tests__/HorizonXTest/StoreFunctionality/cloneDeep.test.js
@@ -13,13 +13,13 @@
* See the Mulan PSL v2 for more details.
*/
-import * as Horizon from '@cloudsop/horizon/index.ts';
-import { clearStore, createStore, useStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
-import { OBSERVER_KEY } from '../../../../libs/horizon/src/horizonx/Constants';
+import * as Inula from '../../../../libs/inula/index';
+import { clearStore, createStore, useStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
+import { OBSERVER_KEY } from '../../../../libs/inula/src/inulax/Constants';
import { App, Text, triggerClickEvent } from '../../jest/commonComponents';
describe('测试对store.state对象进行深度克隆', () => {
- const { unmountComponentAtNode } = Horizon;
+ const { unmountComponentAtNode } = Inula;
let container = null;
beforeEach(() => {
// 创建一个 DOM 元素作为渲染目标
@@ -81,7 +81,7 @@ describe('测试对store.state对象进行深度克隆', () => {
);
}
- it('The observer object of symbol (\'_horizonObserver\') cannot be accessed to from Proxy', () => {
+ it('The observer object of symbol (\'_inulaObserver\') cannot be accessed to from Proxy', () => {
let userStore = null;
function Child(props) {
userStore = useStore('user');
@@ -93,13 +93,13 @@ describe('测试对store.state对象进行深度克隆', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
- // The observer object of symbol ('_horizonObserver') cannot be accessed to from Proxy prevent errors caused by clonedeep.
+ // The observer object of symbol ('_inulaObserver') cannot be accessed to from Proxy prevent errors caused by clonedeep.
expect(userStore.persons[0][OBSERVER_KEY]).toBe(undefined);
});
- it('The observer object of symbol (\'_horizonObserver\') cannot be accessed to from Proxy', () => {
+ it('The observer object of symbol (\'_inulaObserver\') cannot be accessed to from Proxy', () => {
let userStore = null;
function Child(props) {
userStore = useStore('user');
@@ -111,7 +111,7 @@ describe('测试对store.state对象进行深度克隆', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
// NO throw this Exception, TypeError: 'get' on proxy: property 'prototype' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value
const proxyObj = userStore.persons[0].constructor;
diff --git a/scripts/__tests__/HorizonXText/StoreFunctionality/dollarAccess.test.tsx b/scripts/__tests__/HorizonXTest/StoreFunctionality/dollarAccess.test.tsx
similarity index 90%
rename from scripts/__tests__/HorizonXText/StoreFunctionality/dollarAccess.test.tsx
rename to scripts/__tests__/HorizonXTest/StoreFunctionality/dollarAccess.test.tsx
index 0ecd9fca..54c211f5 100644
--- a/scripts/__tests__/HorizonXText/StoreFunctionality/dollarAccess.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StoreFunctionality/dollarAccess.test.tsx
@@ -14,12 +14,12 @@
*/
//@ts-ignore
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../../libs/inula/index';
import { triggerClickEvent } from '../../jest/commonComponents';
import { useLogStore } from './store';
import { describe, beforeEach, afterEach, it, expect } from '@jest/globals';
-const { unmountComponentAtNode } = Horizon;
+const { unmountComponentAtNode } = Inula;
describe('Dollar store access', () => {
let container: HTMLElement | null = null;
@@ -45,7 +45,7 @@ describe('Dollar store access', () => {
return
{logStore.$c.length()}
;
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(document.getElementById(RESULT_ID)?.innerHTML).toBe('1');
});
@@ -69,9 +69,9 @@ describe('Dollar store access', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
diff --git a/scripts/__tests__/HorizonXText/StoreFunctionality/otherCases.test.tsx b/scripts/__tests__/HorizonXTest/StoreFunctionality/otherCases.test.tsx
similarity index 90%
rename from scripts/__tests__/HorizonXText/StoreFunctionality/otherCases.test.tsx
rename to scripts/__tests__/HorizonXTest/StoreFunctionality/otherCases.test.tsx
index 46f5198b..8d473e8b 100644
--- a/scripts/__tests__/HorizonXText/StoreFunctionality/otherCases.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StoreFunctionality/otherCases.test.tsx
@@ -14,12 +14,12 @@
*/
//@ts-ignore
-import * as Horizon from '@cloudsop/horizon/index.ts';
-import { createStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import * as Inula from '../../../../libs/inula/index';
+import { createStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
import { triggerClickEvent } from '../../jest/commonComponents';
import { describe, beforeEach, afterEach, it, expect } from '@jest/globals';
-const { unmountComponentAtNode } = Horizon;
+const { unmountComponentAtNode } = Inula;
describe('Self referencing', () => {
let container: HTMLElement | null = null;
@@ -69,17 +69,17 @@ describe('Self referencing', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(document.getElementById(RESULT_ID)?.innerHTML).toBe('4');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
expect(document.getElementById(RESULT_ID)?.innerHTML).toBe('6');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
@@ -110,11 +110,11 @@ describe('Self referencing', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(document.getElementById(RESULT_ID)?.innerHTML).toBe('5');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
@@ -154,10 +154,10 @@ describe('Self referencing', () => {
);
}
- Horizon.render(
, container);
+ Inula.render(
, container);
expect(document.getElementById(RESULT_ID)?.innerHTML).toBe('abc');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
expect(document.getElementById(RESULT_ID)?.innerHTML).toBe('def');
diff --git a/scripts/__tests__/HorizonXText/StoreFunctionality/reset.js b/scripts/__tests__/HorizonXTest/StoreFunctionality/reset.js
similarity index 87%
rename from scripts/__tests__/HorizonXText/StoreFunctionality/reset.js
rename to scripts/__tests__/HorizonXTest/StoreFunctionality/reset.js
index 6fa0a639..4df7add5 100644
--- a/scripts/__tests__/HorizonXText/StoreFunctionality/reset.js
+++ b/scripts/__tests__/HorizonXTest/StoreFunctionality/reset.js
@@ -13,11 +13,11 @@
* See the Mulan PSL v2 for more details.
*/
-import * as Horizon from '@cloudsop/horizon/index.ts';
-import {createStore} from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import * as Inula from '../../../../libs/inula/index';
+import {createStore} from '../../../../libs/inula/src/inulax/store/StoreHandler';
import {triggerClickEvent} from '../../jest/commonComponents';
-const {unmountComponentAtNode} = Horizon;
+const {unmountComponentAtNode} = Inula;
describe('Reset', () => {
it('RESET NOT IMPLEMENTED', async () => {
@@ -69,25 +69,25 @@ describe('Reset', () => {
, container);
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
expect(document.getElementById(RESULT_ID).innerHTML).toBe('2');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, RESET_ID);
});
expect(document.getElementById(RESULT_ID).innerHTML).toBe('0');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(container, BUTTON_ID);
});
diff --git a/scripts/__tests__/HorizonXText/StoreFunctionality/store.ts b/scripts/__tests__/HorizonXTest/StoreFunctionality/store.ts
similarity index 92%
rename from scripts/__tests__/HorizonXText/StoreFunctionality/store.ts
rename to scripts/__tests__/HorizonXTest/StoreFunctionality/store.ts
index 4831afd3..f37d4547 100644
--- a/scripts/__tests__/HorizonXText/StoreFunctionality/store.ts
+++ b/scripts/__tests__/HorizonXTest/StoreFunctionality/store.ts
@@ -13,7 +13,7 @@
* See the Mulan PSL v2 for more details.
*/
-import { createStore } from '../../../../libs/horizon/src/horizonx/store/StoreHandler';
+import { createStore } from '../../../../libs/inula/src/inulax/store/StoreHandler';
export const useLogStore = createStore({
id: 'logStore', // you do not need to specify ID for local store
diff --git a/scripts/__tests__/HorizonXText/StoreFunctionality/utils.test.js b/scripts/__tests__/HorizonXTest/StoreFunctionality/utils.test.js
similarity index 85%
rename from scripts/__tests__/HorizonXText/StoreFunctionality/utils.test.js
rename to scripts/__tests__/HorizonXTest/StoreFunctionality/utils.test.js
index 7d1f786f..ff9f0629 100644
--- a/scripts/__tests__/HorizonXText/StoreFunctionality/utils.test.js
+++ b/scripts/__tests__/HorizonXTest/StoreFunctionality/utils.test.js
@@ -1,4 +1,4 @@
-import { resolveMutation } from '../../../../libs/horizon/src/horizonx/CommonUtils';
+import { resolveMutation } from '../../../../libs/inula/src/inulax/CommonUtils';
describe('Mutation resolve', () => {
it('should resolve mutation different types', () => {
@@ -64,7 +64,6 @@ describe('Mutation resolve', () => {
it('should resolve mutation same type types, same object', () => {
const mutation = resolveMutation({ a: 1, b: 2 }, { a: 1, b: 2 });
- console.log(mutation);
expect(mutation.mutation).toBe(false);
});
@@ -78,3 +77,17 @@ describe('Mutation resolve', () => {
expect(mutation.attributes.c.to).toBe(2);
});
});
+
+describe('Mutation collections', () => {
+ it('should resolve mutation of two sets', () => {
+ const values = [{ a: 1 }, { b: 2 }, { c: 3 }];
+
+ const source = new Set([values[0], values[1], values[2]]);
+
+ const target = new Set([values[0], values[1]]);
+
+ const mutation = resolveMutation(source, target);
+
+ expect(mutation.mutation).toBe(true);
+ });
+});
diff --git a/scripts/__tests__/HorizonXText/StoreFunctionality/watch.test.tsx b/scripts/__tests__/HorizonXTest/StoreFunctionality/watch.test.tsx
similarity index 93%
rename from scripts/__tests__/HorizonXText/StoreFunctionality/watch.test.tsx
rename to scripts/__tests__/HorizonXTest/StoreFunctionality/watch.test.tsx
index 1aa765c3..5d51aa76 100644
--- a/scripts/__tests__/HorizonXText/StoreFunctionality/watch.test.tsx
+++ b/scripts/__tests__/HorizonXTest/StoreFunctionality/watch.test.tsx
@@ -13,11 +13,11 @@
* See the Mulan PSL v2 for more details.
*/
-import { createStore } from '@cloudsop/horizon/src/horizonx/store/StoreHandler';
-import { watch } from '@cloudsop/horizon/src/horizonx/proxy/watch';
+import { createStore } from '../../../../libs/inula';
+import { watch } from '../../../../libs/inula';
describe('watch', () => {
- it('shouhld watch promitive state variable', async () => {
+ it('shouhld watch primitive state variable', async () => {
const useStore = createStore({
state: {
variable: 'x',
diff --git a/scripts/__tests__/HorizonXText/adapters/ReduxAdapter.test.tsx b/scripts/__tests__/HorizonXTest/adapters/ReduxAdapter.test.tsx
similarity index 98%
rename from scripts/__tests__/HorizonXText/adapters/ReduxAdapter.test.tsx
rename to scripts/__tests__/HorizonXTest/adapters/ReduxAdapter.test.tsx
index 16e5bbe7..431719f5 100644
--- a/scripts/__tests__/HorizonXText/adapters/ReduxAdapter.test.tsx
+++ b/scripts/__tests__/HorizonXTest/adapters/ReduxAdapter.test.tsx
@@ -14,13 +14,13 @@
*/
//@ts-ignore
-import * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../../libs/inula/index';
import {
createStore,
applyMiddleware,
combineReducers,
bindActionCreators,
-} from '../../../../libs/horizon/src/horizonx/adapters/redux';
+} from '../../../../libs/inula/src/inulax/adapters/redux';
import { describe, it, expect } from '@jest/globals';
describe('Redux adapter', () => {
diff --git a/scripts/__tests__/HorizonXText/adapters/ReduxAdapterThunk.test.tsx b/scripts/__tests__/HorizonXTest/adapters/ReduxAdapterThunk.test.tsx
similarity index 93%
rename from scripts/__tests__/HorizonXText/adapters/ReduxAdapterThunk.test.tsx
rename to scripts/__tests__/HorizonXTest/adapters/ReduxAdapterThunk.test.tsx
index c7ccf8b2..2507f28a 100644
--- a/scripts/__tests__/HorizonXText/adapters/ReduxAdapterThunk.test.tsx
+++ b/scripts/__tests__/HorizonXTest/adapters/ReduxAdapterThunk.test.tsx
@@ -13,8 +13,8 @@
* See the Mulan PSL v2 for more details.
*/
-import * as Horizon from '@cloudsop/horizon/index.ts';
-import { createStore, applyMiddleware, thunk } from '../../../../libs/horizon/src/horizonx/adapters/redux';
+import * as Inula from '../../../../libs/inula/index';
+import { createStore, applyMiddleware, thunk } from '../../../../libs/inula/src/inulax/adapters/redux';
import {describe, it, expect} from '@jest/globals';
describe('Redux thunk', () => {
diff --git a/scripts/__tests__/HorizonXText/adapters/ReduxReactAdapter.test.tsx b/scripts/__tests__/HorizonXTest/adapters/ReduxReactAdapter.test.tsx
similarity index 89%
rename from scripts/__tests__/HorizonXText/adapters/ReduxReactAdapter.test.tsx
rename to scripts/__tests__/HorizonXTest/adapters/ReduxReactAdapter.test.tsx
index bf31c13a..b2402c90 100644
--- a/scripts/__tests__/HorizonXText/adapters/ReduxReactAdapter.test.tsx
+++ b/scripts/__tests__/HorizonXTest/adapters/ReduxReactAdapter.test.tsx
@@ -14,7 +14,7 @@
*/
//@ts-ignore
-import horizon, * as Horizon from '@cloudsop/horizon/index.ts';
+import * as Inula from '../../../../libs/inula/index';
import {
batch,
connect,
@@ -25,10 +25,10 @@ import {
useStore,
createSelectorHook,
createDispatchHook
-} from '../../../../libs/horizon/src/horizonx/adapters/redux';
+} from '../../../../libs/inula/src/inulax/adapters/redux';
import {triggerClickEvent} from '../../jest/commonComponents';
import {describe, it, beforeEach, afterEach, expect} from '@jest/globals';
-import { ReduxStoreHandler } from '@cloudsop/horizon/src/horizonx/types';
+import { ReduxStoreHandler } from '../../../../libs/inula/src/inulax/adapters/redux';
const BUTTON = 'button';
const BUTTON2 = 'button2';
@@ -64,7 +64,7 @@ describe('Redux/React binding adapter', () => {
;
};
- Horizon.render(
, getE(CONTAINER));
expect(getE(RESULT).innerHTML).toBe('state');
});
@@ -92,11 +92,11 @@ describe('Redux/React binding adapter', () => {
;
};
- Horizon.render(
, getE(CONTAINER));
expect(reduxStore.getState()).toBe(0);
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(getE(CONTAINER), BUTTON);
});
@@ -127,11 +127,11 @@ describe('Redux/React binding adapter', () => {
;
};
- Horizon.render(
, getE(CONTAINER));
expect(getE(RESULT).innerHTML).toBe('0');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(getE(CONTAINER), BUTTON);
triggerClickEvent(getE(CONTAINER), BUTTON);
});
@@ -181,7 +181,7 @@ describe('Redux/React binding adapter', () => {
const Wrapper = () => {
//@ts-ignore
- const [amount, setAmount] = Horizon.useState(5);
+ const [amount, setAmount] = Inula.useState(5);
return
, getE(CONTAINER));
expect(getE(RESULT).innerHTML).toBe('+0');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(getE(CONTAINER), BUTTON);
});
expect(getE(RESULT).innerHTML).toBe('+5');
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(getE(CONTAINER), BUTTON2);
});
- Horizon.act(() => {
+ Inula.act(() => {
triggerClickEvent(getE(CONTAINER), BUTTON);
});
@@ -238,12 +238,12 @@ describe('Redux/React binding adapter', () => {