@@ -17,6 +17,34 @@ describe('dialog', () => {
1717 jest . useRealTimers ( ) ;
1818 } ) ;
1919
20+ it ( 'should render correct' , ( ) => {
21+ const wrapper = mount ( < Dialog visible /> ) ;
22+ jest . runAllTimers ( ) ;
23+ wrapper . update ( ) ;
24+
25+ expect ( wrapper . render ( ) ) . toMatchSnapshot ( ) ;
26+ } ) ;
27+
28+ it ( 'add rootClassName should render correct' , ( ) => {
29+ const wrapper = mount (
30+ < Dialog
31+ visible
32+ rootClassName = "customize-root-class"
33+ style = { { width : 600 } }
34+ height = { 903 }
35+ wrapStyle = { { fontSize : 10 } }
36+ /> ,
37+ ) ;
38+ jest . runAllTimers ( ) ;
39+ wrapper . update ( ) ;
40+
41+ expect ( wrapper . render ( ) ) . toMatchSnapshot ( ) ;
42+ expect ( wrapper . find ( '.customize-root-class' ) . length ) . toBeTruthy ( ) ;
43+ expect ( wrapper . find ( '.rc-dialog-wrap' ) . props ( ) . style . fontSize ) . toBe ( 10 ) ;
44+ expect ( wrapper . find ( '.rc-dialog' ) . props ( ) . style . height ) . toEqual ( 903 ) ;
45+ expect ( wrapper . find ( '.rc-dialog' ) . props ( ) . style . width ) . toEqual ( 600 ) ;
46+ } ) ;
47+
2048 it ( 'show' , ( ) => {
2149 const wrapper = mount ( < Dialog visible /> ) ;
2250 jest . runAllTimers ( ) ;
@@ -92,10 +120,10 @@ describe('dialog', () => {
92120 jest . runAllTimers ( ) ;
93121 wrapper . update ( ) ;
94122
95- ( ( document . getElementsByClassName ( '.test-input' ) as unknown ) as HTMLInputElement ) . value =
123+ ( document . getElementsByClassName ( '.test-input' ) as unknown as HTMLInputElement ) . value =
96124 'test' ;
97125 expect (
98- ( ( document . getElementsByClassName ( '.test-input' ) as unknown ) as HTMLInputElement ) . value ,
126+ ( document . getElementsByClassName ( '.test-input' ) as unknown as HTMLInputElement ) . value ,
99127 ) . toBe ( 'test' ) ;
100128
101129 // Hide
@@ -109,7 +137,7 @@ describe('dialog', () => {
109137 wrapper . update ( ) ;
110138
111139 expect (
112- ( ( document . getElementsByClassName ( '.test-input' ) as unknown ) as HTMLInputElement ) . value ,
140+ ( document . getElementsByClassName ( '.test-input' ) as unknown as HTMLInputElement ) . value ,
113141 ) . toBeUndefined ( ) ;
114142 wrapper . unmount ( ) ;
115143 } ) ;
@@ -208,9 +236,9 @@ describe('dialog', () => {
208236 describe ( 'Tab should keep focus in dialog' , ( ) => {
209237 it ( 'basic tabbing' , ( ) => {
210238 const wrapper = mount ( < Dialog visible /> , { attachTo : document . body } ) ;
211- const sentinelEnd = ( document . querySelectorAll (
239+ const sentinelEnd = document . querySelectorAll (
212240 '.rc-dialog-content + div' ,
213- ) [ 0 ] as unknown ) as HTMLDivElement ;
241+ ) [ 0 ] as unknown as HTMLDivElement ;
214242 sentinelEnd . focus ( ) ;
215243
216244 wrapper . find ( '.rc-dialog-wrap' ) . simulate ( 'keyDown' , {
0 commit comments