From da3cd0bf182c1a23b1edb0dd3502c22e5cb2a873 Mon Sep 17 00:00:00 2001 From: Wanpan Date: Tue, 23 Apr 2024 19:41:03 +0800 Subject: [PATCH] test: fix onPopupScroll evt is null --- examples/basic.tsx | 1 - tests/Select.props.spec.js | 5 +- .../Select.checkable.spec.tsx.snap | 644 +++++++------- tests/__snapshots__/Select.spec.tsx.snap | 787 +++++++++--------- 4 files changed, 747 insertions(+), 690 deletions(-) diff --git a/examples/basic.tsx b/examples/basic.tsx index 2587f0b8..71dfb35b 100644 --- a/examples/basic.tsx +++ b/examples/basic.tsx @@ -427,7 +427,6 @@ class Demo extends React.Component { - , ); } diff --git a/tests/Select.props.spec.js b/tests/Select.props.spec.js index 83c3e96e..d9b40225 100644 --- a/tests/Select.props.spec.js +++ b/tests/Select.props.spec.js @@ -244,7 +244,10 @@ describe('TreeSelect.props', () => { }); it('onPopupScroll', async () => { - const onPopupScroll = jest.fn(); + const onPopupScroll = jest.fn(e => { + // Prevents React from resetting its properties: + e.persist(); + }); render(
-
-
+
+
-
-
-
@@ -352,110 +357,115 @@ exports[`TreeSelect.checkable uncheck remove by selector not treeCheckStrictly 2
-
-
+
+
-
-
-
@@ -625,110 +635,115 @@ exports[`TreeSelect.checkable uncheck remove by tree check 1`] = `
-
-
+
+
-
-
-
@@ -817,110 +832,115 @@ exports[`TreeSelect.checkable uncheck remove by tree check 2`] = `
-
-
+
+
-
-
-
diff --git a/tests/__snapshots__/Select.spec.tsx.snap b/tests/__snapshots__/Select.spec.tsx.snap index 1e449191..8b0c118a 100644 --- a/tests/__snapshots__/Select.spec.tsx.snap +++ b/tests/__snapshots__/Select.spec.tsx.snap @@ -64,124 +64,129 @@ exports[`TreeSelect.basic render renders TreeNode correctly 1`] = `
-
-
+
+
-
-
-
@@ -257,124 +262,129 @@ exports[`TreeSelect.basic render renders TreeNode correctly with falsy child 1`]
-
-
+
+
-
-
-
@@ -587,68 +597,73 @@ exports[`TreeSelect.basic render renders treeDataSimpleMode correctly 1`] = `
-
-
+
+
-
-
-
@@ -724,38 +739,43 @@ exports[`TreeSelect.basic search nodes check tree changed by filter 1`] = `
-
-
+
+
-
@@ -831,64 +851,69 @@ exports[`TreeSelect.basic search nodes check tree changed by filter 2`] = `
-
-
+
+
-
-
-
@@ -964,64 +989,69 @@ exports[`TreeSelect.basic search nodes filter node but not remove then 1`] = `
-
-
+
+
-
-
-
@@ -1095,64 +1125,69 @@ exports[`TreeSelect.basic search nodes renders search input 1`] = `
-
-
+
+
-
-
-