testeranto 0.48.9 → 0.48.14
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/subPackages/react-dom/jsx/node.js +1 -1
- package/dist/common/subPackages/react-dom/jsx/web.js +40 -41
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/subPackages/react-dom/jsx/node.js +1 -1
- package/dist/module/subPackages/react-dom/jsx/web.js +40 -41
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/subPackages/react-dom/jsx/web.d.ts +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/subPackages/react-dom/jsx/node.ts +2 -1
- package/src/subPackages/react-dom/jsx/web.ts +73 -73
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import Testeranto from "../../../Web";
|
|
2
|
+
|
|
1
3
|
import React, {
|
|
2
4
|
useEffect, useRef,
|
|
3
5
|
} from "react";
|
|
4
6
|
import ReactDom from "react-dom/client";
|
|
5
7
|
|
|
6
8
|
import { ITTestShape, ITestImplementation, ITestSpecification } from "../../../core";
|
|
7
|
-
import Testeranto from "../../../../src/Web";
|
|
8
9
|
|
|
9
10
|
type Input = [string, (string) => string, any];
|
|
10
11
|
type InitialState = unknown;
|
|
@@ -38,80 +39,79 @@ export default <ITestShape extends ITTestShape>(
|
|
|
38
39
|
>,
|
|
39
40
|
testInput: Prototype
|
|
40
41
|
) => {
|
|
41
|
-
|
|
42
|
-
const
|
|
42
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
43
|
+
const elem = document.getElementById("root");
|
|
44
|
+
if (elem) {
|
|
45
|
+
const TesterantoComponent = function (props) {
|
|
46
|
+
const myContainer = useRef(null);
|
|
43
47
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
console.log(
|
|
50
|
+
"This only happens ONCE. It happens AFTER the initial render."
|
|
51
|
+
);
|
|
52
|
+
// eslint-disable-next-line react/prop-types
|
|
53
|
+
props.done(myContainer.current);
|
|
54
|
+
}, []);
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
return React.createElement('div', { ref: myContainer }, testInput()); //testInput();
|
|
57
|
+
};
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return await new Promise((resolve, rej) => {
|
|
75
|
-
document.addEventListener("DOMContentLoaded", function () {
|
|
76
|
-
const elem = document.getElementById("root");
|
|
77
|
-
if (elem) {
|
|
59
|
+
Testeranto<
|
|
60
|
+
ITestShape,
|
|
61
|
+
Prototype,
|
|
62
|
+
ISubject,
|
|
63
|
+
IStore,
|
|
64
|
+
ISelection,
|
|
65
|
+
IThenShape,
|
|
66
|
+
IWhenShape,
|
|
67
|
+
InitialState
|
|
68
|
+
>(
|
|
69
|
+
testInput,
|
|
70
|
+
testSpecifications,
|
|
71
|
+
testImplementations,
|
|
72
|
+
{
|
|
73
|
+
beforeAll: async (
|
|
74
|
+
prototype,
|
|
75
|
+
artificer
|
|
76
|
+
): Promise<ISubject> => {
|
|
77
|
+
return new Promise((resolve, rej) => {
|
|
78
78
|
resolve({ root: elem });
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
)
|
|
79
|
+
})
|
|
80
|
+
},
|
|
81
|
+
beforeEach: async (
|
|
82
|
+
{ root },
|
|
83
|
+
ndx,
|
|
84
|
+
testRsource,
|
|
85
|
+
artificer
|
|
86
|
+
): Promise<IStore> => {
|
|
87
|
+
return new Promise((resolve, rej) => {
|
|
88
|
+
ReactDom.createRoot(root).
|
|
89
|
+
render(
|
|
90
|
+
React.createElement(
|
|
91
|
+
TesterantoComponent, {
|
|
92
|
+
done: (react) => resolve({ root, react })
|
|
93
|
+
}, []));
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
andWhen: function (s: IStore, actioner): Promise<ISelection> {
|
|
97
|
+
return actioner()(s);
|
|
98
|
+
},
|
|
99
|
+
butThen: async function (s: IStore): Promise<ISelection> {
|
|
100
|
+
return s;
|
|
101
|
+
},
|
|
102
|
+
afterEach: async function (
|
|
103
|
+
store: IStore,
|
|
104
|
+
ndx,
|
|
105
|
+
artificer
|
|
106
|
+
) {
|
|
107
|
+
return {};
|
|
108
|
+
},
|
|
109
|
+
afterAll: (store: IStore, artificer) => {
|
|
110
|
+
// store.page.browser().close();
|
|
111
|
+
return;
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
117
|
};
|