File tree Expand file tree Collapse file tree 5 files changed +1
-47
lines changed
Expand file tree Collapse file tree 5 files changed +1
-47
lines changed Original file line number Diff line number Diff line change 11module . exports = {
22 setupFiles : [ './tests/setup.js' ] ,
3- snapshotSerializers : [ require . resolve ( 'enzyme-to-json/serializer' ) ] ,
43} ;
Original file line number Diff line number Diff line change 5454 "@rc-component/np" : " ^1.0.3" ,
5555 "@rc-component/trigger" : " ^3.0.0" ,
5656 "@testing-library/react" : " ^12.1.5" ,
57- "@types/enzyme" : " ^3.1.15" ,
5857 "@types/jest" : " ^29.4.0" ,
5958 "@types/node" : " ^24.5.2" ,
6059 "@types/react" : " ^19.0.0" ,
6665 "core-js" : " ^3.40.0" ,
6766 "cross-env" : " ^7.0.0" ,
6867 "dumi" : " ^2.1.10" ,
69- "enzyme" : " ^3.3.0" ,
70- "enzyme-adapter-react-16" : " ^1.15.6" ,
71- "enzyme-to-json" : " ^3.2.1" ,
7268 "eslint" : " ^8.54.0" ,
7369 "eslint-plugin-jest" : " ^28.8.3" ,
7470 "eslint-plugin-unicorn" : " ^56.0.1" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,28 +4,6 @@ global.requestAnimationFrame =
44 return setTimeout ( cb , 0 ) ;
55 } ;
66
7- const Enzyme = require ( 'enzyme' ) ;
8- const Adapter = require ( 'enzyme-adapter-react-16' ) ;
9-
10- Enzyme . configure ( { adapter : new Adapter ( ) } ) ;
11-
12- Object . assign ( Enzyme . ReactWrapper . prototype , {
13- isOpen ( ) {
14- return ! ! this . find ( 'Trigger' ) . props ( ) . popupVisible ;
15- } ,
16- findOption ( menuIndex , itemIndex ) {
17- const menu = this . find ( 'ul.rc-cascader-menu' ) . at ( menuIndex ) ;
18- const itemList = menu . find ( 'li.rc-cascader-menu-item' ) ;
19-
20- return itemList . at ( itemIndex ) ;
21- } ,
22- clickOption ( menuIndex , itemIndex , type = 'click' ) {
23- this . findOption ( menuIndex , itemIndex ) . simulate ( type ) ;
24-
25- return this ;
26- } ,
27- } ) ;
28-
297window . HTMLElement . prototype . scrollIntoView = jest . fn ( ) ;
308
319window . MessageChannel = class {
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export function selectOption(
3838 }
3939}
4040
41- // Helper functions to replace enzyme-specific functionality
41+ // Helper functions for testing
4242export function isOpen ( container : HTMLElement ) : boolean {
4343 // Check the dropdown visibility
4444 const dropdown = container . querySelector ( '.rc-cascader-dropdown' ) ;
You can’t perform that action at this time.
0 commit comments