@@ -8,6 +8,7 @@ import ZoomOutOutlined from '@ant-design/icons/ZoomOutOutlined';
88import CloseOutlined from '@ant-design/icons/CloseOutlined' ;
99import LeftOutlined from '@ant-design/icons/LeftOutlined' ;
1010import RightOutlined from '@ant-design/icons/RightOutlined' ;
11+ import ReloadOutlined from '@ant-design/icons/ReloadOutlined' ;
1112
1213jest . mock ( '../src/Preview' , ( ) => {
1314 const MockPreview = ( props : any ) => {
@@ -118,15 +119,15 @@ describe('Preview', () => {
118119 jest . runAllTimers ( ) ;
119120 } ) ;
120121
121- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 3 ] ) ;
122+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 4 ] ) ;
122123 act ( ( ) => {
123124 jest . runAllTimers ( ) ;
124125 } ) ;
125126 expect ( document . querySelector ( '.rc-image-preview-img' ) ) . toHaveStyle ( {
126127 transform : 'translate3d(0px, 0px, 0) scale3d(1, 1, 1) rotate(90deg)' ,
127128 } ) ;
128129
129- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 4 ] ) ;
130+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 5 ] ) ;
130131 act ( ( ) => {
131132 jest . runAllTimers ( ) ;
132133 } ) ;
@@ -145,31 +146,31 @@ describe('Preview', () => {
145146 jest . runAllTimers ( ) ;
146147 } ) ;
147148
148- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 5 ] ) ;
149+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 6 ] ) ;
149150 act ( ( ) => {
150151 jest . runAllTimers ( ) ;
151152 } ) ;
152153 expect ( document . querySelector ( '.rc-image-preview-img' ) ) . toHaveStyle ( {
153154 transform : 'translate3d(0px, 0px, 0) scale3d(-1, 1, 1) rotate(0deg)' ,
154155 } ) ;
155156
156- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 6 ] ) ;
157+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 7 ] ) ;
157158 act ( ( ) => {
158159 jest . runAllTimers ( ) ;
159160 } ) ;
160161 expect ( document . querySelector ( '.rc-image-preview-img' ) ) . toHaveStyle ( {
161162 transform : 'translate3d(0px, 0px, 0) scale3d(-1, -1, 1) rotate(0deg)' ,
162163 } ) ;
163164
164- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 5 ] ) ;
165+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 6 ] ) ;
165166 act ( ( ) => {
166167 jest . runAllTimers ( ) ;
167168 } ) ;
168169 expect ( document . querySelector ( '.rc-image-preview-img' ) ) . toHaveStyle ( {
169170 transform : 'translate3d(0px, 0px, 0) scale3d(1, -1, 1) rotate(0deg)' ,
170171 } ) ;
171172
172- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 6 ] ) ;
173+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 7 ] ) ;
173174 act ( ( ) => {
174175 jest . runAllTimers ( ) ;
175176 } ) ;
@@ -188,23 +189,23 @@ describe('Preview', () => {
188189 jest . runAllTimers ( ) ;
189190 } ) ;
190191
191- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 2 ] ) ;
192+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 3 ] ) ;
192193 act ( ( ) => {
193194 jest . runAllTimers ( ) ;
194195 } ) ;
195196 expect ( document . querySelector ( '.rc-image-preview-img' ) ) . toHaveStyle ( {
196197 transform : 'translate3d(0px, 0px, 0) scale3d(1, 1, 1) rotate(0deg)' ,
197198 } ) ;
198199
199- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 1 ] ) ;
200+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 2 ] ) ;
200201 act ( ( ) => {
201202 jest . runAllTimers ( ) ;
202203 } ) ;
203204 expect ( document . querySelector ( '.rc-image-preview-img' ) ) . toHaveStyle ( {
204205 transform : 'translate3d(-256px, -192px, 0) scale3d(1.5, 1.5, 1) rotate(0deg)' ,
205206 } ) ;
206207
207- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 2 ] ) ;
208+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 3 ] ) ;
208209 act ( ( ) => {
209210 jest . runAllTimers ( ) ;
210211 } ) ;
@@ -261,23 +262,23 @@ describe('Preview', () => {
261262 jest . runAllTimers ( ) ;
262263 } ) ;
263264
264- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 2 ] ) ;
265+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 3 ] ) ;
265266 act ( ( ) => {
266267 jest . runAllTimers ( ) ;
267268 } ) ;
268269 expect ( document . querySelector ( '.rc-image-preview-img' ) ) . toHaveStyle ( {
269270 transform : 'translate3d(0px, 0px, 0) scale3d(1, 1, 1) rotate(0deg)' ,
270271 } ) ;
271272
272- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 1 ] ) ;
273+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 2 ] ) ;
273274 act ( ( ) => {
274275 jest . runAllTimers ( ) ;
275276 } ) ;
276277 expect ( document . querySelector ( '.rc-image-preview-img' ) ) . toHaveStyle ( {
277278 transform : 'translate3d(-512px, -384px, 0) scale3d(2, 2, 1) rotate(0deg)' ,
278279 } ) ;
279280
280- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 2 ] ) ;
281+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 3 ] ) ;
281282 act ( ( ) => {
282283 jest . runAllTimers ( ) ;
283284 } ) ;
@@ -317,7 +318,7 @@ describe('Preview', () => {
317318 jest . runAllTimers ( ) ;
318319 } ) ;
319320
320- fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 1 ] ) ;
321+ fireEvent . click ( document . querySelectorAll ( '.rc-image-preview-operations-operation' ) [ 2 ] ) ;
321322 act ( ( ) => {
322323 jest . runAllTimers ( ) ;
323324 } ) ;
@@ -572,6 +573,7 @@ describe('Preview', () => {
572573 zoomIn : < ZoomInOutlined /> ,
573574 zoomOut : < ZoomOutOutlined /> ,
574575 close : < CloseOutlined /> ,
576+ refresh : < ReloadOutlined /> ,
575577 left : < LeftOutlined /> ,
576578 right : < RightOutlined /> ,
577579 } }
0 commit comments