testeranto 0.49.8 → 0.49.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/Project.js +1 -1
- package/dist/common/Web.js +7 -1
- package/dist/common/subPackages/react-dom/jsx/web.js +11 -15
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Project.js +1 -1
- package/dist/module/Web.js +7 -1
- package/dist/module/subPackages/react-dom/jsx/web.js +11 -15
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/subPackages/react-dom/jsx/index.d.ts +3 -3
- package/dist/types/subPackages/react-dom/jsx/web.d.ts +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Project.ts +3 -2
- package/src/Web.ts +6 -2
- package/src/subPackages/react-dom/jsx/index.ts +4 -5
- package/src/subPackages/react-dom/jsx/node.ts +1 -2
- package/src/subPackages/react-dom/jsx/web.ts +27 -22
|
@@ -4,6 +4,7 @@ import React, {
|
|
|
4
4
|
useEffect, useRef,
|
|
5
5
|
} from "react";
|
|
6
6
|
import ReactDom from "react-dom/client";
|
|
7
|
+
import { createPortal } from 'react-dom';
|
|
7
8
|
|
|
8
9
|
import { ITTestShape, ITestImplementation, ITestSpecification } from "../../../core";
|
|
9
10
|
import {
|
|
@@ -13,7 +14,10 @@ import {
|
|
|
13
14
|
|
|
14
15
|
export type ISubject = HTMLElement;
|
|
15
16
|
|
|
16
|
-
export default <
|
|
17
|
+
export default <
|
|
18
|
+
ITestShape extends ITTestShape,
|
|
19
|
+
IProps
|
|
20
|
+
>(
|
|
17
21
|
testImplementations: ITestImplementation<
|
|
18
22
|
IState,
|
|
19
23
|
ISelection,
|
|
@@ -23,6 +27,7 @@ export default <ITestShape extends ITTestShape>(
|
|
|
23
27
|
>,
|
|
24
28
|
testSpecifications: ITestSpecification<
|
|
25
29
|
ITestShape,
|
|
30
|
+
// [HTMLElement, IProps], // ISubject,
|
|
26
31
|
ISubject,
|
|
27
32
|
IStore,
|
|
28
33
|
ISelection,
|
|
@@ -42,12 +47,12 @@ export default <ITestShape extends ITTestShape>(
|
|
|
42
47
|
"useEffect called", myContainer.current
|
|
43
48
|
);
|
|
44
49
|
|
|
45
|
-
if (!myContainer.current) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} else {
|
|
49
|
-
|
|
50
|
-
}
|
|
50
|
+
// if (!myContainer.current) {
|
|
51
|
+
// // do componentDidMount logic
|
|
52
|
+
// myContainer.current = true;
|
|
53
|
+
// } else {
|
|
54
|
+
// // do componentDidUpdate logic
|
|
55
|
+
// }
|
|
51
56
|
|
|
52
57
|
done(myContainer.current);
|
|
53
58
|
}, []);
|
|
@@ -62,6 +67,7 @@ export default <ITestShape extends ITTestShape>(
|
|
|
62
67
|
Testeranto<
|
|
63
68
|
ITestShape,
|
|
64
69
|
IInput,
|
|
70
|
+
// [HTMLElement, IProps], // ISubject,
|
|
65
71
|
ISubject,
|
|
66
72
|
IStore,
|
|
67
73
|
ISelection,
|
|
@@ -76,7 +82,7 @@ export default <ITestShape extends ITTestShape>(
|
|
|
76
82
|
beforeAll: async (
|
|
77
83
|
input,
|
|
78
84
|
artificer
|
|
79
|
-
): Promise<
|
|
85
|
+
): Promise<HTMLElement> => {
|
|
80
86
|
console.log("beforeAll", input);
|
|
81
87
|
return await new Promise((resolve, rej) => {
|
|
82
88
|
resolve(rootElement);
|
|
@@ -93,20 +99,19 @@ export default <ITestShape extends ITTestShape>(
|
|
|
93
99
|
|
|
94
100
|
console.log("beforeEach", subject);
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
[]));
|
|
102
|
+
createPortal(
|
|
103
|
+
TesterantoComponent({
|
|
104
|
+
innerComp: testInput,
|
|
105
|
+
done: (reactElement: any) => {
|
|
106
|
+
process.nextTick(() => {
|
|
107
|
+
resolve(reactElement)// do something
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
,
|
|
112
|
+
),
|
|
113
|
+
rootElement
|
|
114
|
+
);
|
|
110
115
|
});
|
|
111
116
|
},
|
|
112
117
|
andWhen: function (s: IStore, actioner): Promise<ISelection> {
|