@@ -138,6 +138,44 @@ describe('createPluginActions', () => {
138
138
} satisfies Partial < ModalChangeMessage > ) ,
139
139
)
140
140
} )
141
+ it ( 'sends modalSize to the container when opening the modal' , ( ) => {
142
+ const { uid, postToContainer, onUpdateState } = mock ( )
143
+ const {
144
+ actions : { setModalOpen } ,
145
+ } = createPluginActions ( {
146
+ uid,
147
+ postToContainer,
148
+ onUpdateState,
149
+ validateContent,
150
+ } )
151
+
152
+ setModalOpen ( true , { width : '50%' } )
153
+ expect ( postToContainer ) . toHaveBeenCalledWith (
154
+ expect . objectContaining ( {
155
+ event : 'toggleModal' ,
156
+ status : true ,
157
+ modalSize : { width : '50%' } ,
158
+ } satisfies Partial < ModalChangeMessage > ) ,
159
+ )
160
+
161
+ setModalOpen ( true , { height : '50%' } )
162
+ expect ( postToContainer ) . toHaveBeenCalledWith (
163
+ expect . objectContaining ( {
164
+ event : 'toggleModal' ,
165
+ status : true ,
166
+ modalSize : { height : '50%' } ,
167
+ } satisfies Partial < ModalChangeMessage > ) ,
168
+ )
169
+
170
+ setModalOpen ( true , { width : '50%' , height : '50%' } )
171
+ expect ( postToContainer ) . toHaveBeenCalledWith (
172
+ expect . objectContaining ( {
173
+ event : 'toggleModal' ,
174
+ status : true ,
175
+ modalSize : { width : '50%' , height : '50%' } ,
176
+ } satisfies Partial < ModalChangeMessage > ) ,
177
+ )
178
+ } )
141
179
} )
142
180
describe ( 'value state change' , ( ) => {
143
181
it ( 'updates the value state when setContent is called' , ( ) => {
0 commit comments