@elliemae/pui-cli 9.0.0-next.65 → 9.0.0-next.67
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.
|
@@ -24,3 +24,30 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
var React = __toESM(require("react"));
|
|
25
25
|
var import_jest_styled_components = require("jest-styled-components");
|
|
26
26
|
global.React = React;
|
|
27
|
+
try {
|
|
28
|
+
jest.mock("@tanstack/react-virtual", () => {
|
|
29
|
+
const original = jest.requireActual("@tanstack/react-virtual");
|
|
30
|
+
return {
|
|
31
|
+
...original,
|
|
32
|
+
useVirtualizer: jest.fn((virtualOpts) => {
|
|
33
|
+
const finalOpts = {
|
|
34
|
+
...virtualOpts,
|
|
35
|
+
overscan: 15,
|
|
36
|
+
initialRect: {
|
|
37
|
+
height: 500,
|
|
38
|
+
width: 400
|
|
39
|
+
},
|
|
40
|
+
observeElementRect: (_, cb) => {
|
|
41
|
+
cb({ height: 500, width: 400 });
|
|
42
|
+
},
|
|
43
|
+
measureElement: () => 100
|
|
44
|
+
};
|
|
45
|
+
return original.useVirtualizer(finalOpts);
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
} catch (e) {
|
|
50
|
+
console.log(
|
|
51
|
+
"Failed to mock @tanstack/react-virtual, test will operate without virtualization mocks"
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import "jest-styled-components";
|
|
3
3
|
global.React = React;
|
|
4
|
+
try {
|
|
5
|
+
jest.mock("@tanstack/react-virtual", () => {
|
|
6
|
+
const original = jest.requireActual("@tanstack/react-virtual");
|
|
7
|
+
return {
|
|
8
|
+
...original,
|
|
9
|
+
useVirtualizer: jest.fn((virtualOpts) => {
|
|
10
|
+
const finalOpts = {
|
|
11
|
+
...virtualOpts,
|
|
12
|
+
overscan: 15,
|
|
13
|
+
initialRect: {
|
|
14
|
+
height: 500,
|
|
15
|
+
width: 400
|
|
16
|
+
},
|
|
17
|
+
observeElementRect: (_, cb) => {
|
|
18
|
+
cb({ height: 500, width: 400 });
|
|
19
|
+
},
|
|
20
|
+
measureElement: () => 100
|
|
21
|
+
};
|
|
22
|
+
return original.useVirtualizer(finalOpts);
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.log(
|
|
28
|
+
"Failed to mock @tanstack/react-virtual, test will operate without virtualization mocks"
|
|
29
|
+
);
|
|
30
|
+
}
|