@@ -222,31 +222,36 @@ describe('SystemItemsDialog', () => {
222222 await user . click ( screen . getByLabelText ( 'navigate to systems home' ) ) ;
223223
224224 await waitFor ( ( ) => {
225- expect ( screen . getByText ( 'Giant laser ' ) ) . toBeInTheDocument ( ) ;
225+ expect ( screen . getByText ( 'Pulse Laser ' ) ) . toBeInTheDocument ( ) ;
226226 } ) ;
227227
228- await user . click ( screen . getByText ( 'Giant laser ' ) ) ;
228+ await user . click ( screen . getByText ( 'Pulse Laser ' ) ) ;
229229
230- await waitFor ( ( ) => {
231- expect ( screen . getByText ( 'Smaller laser' ) ) . toBeInTheDocument ( ) ;
232- } ) ;
230+ expect (
231+ await screen . findByText ( 'Item Moving Rule Applied' )
232+ ) . toBeInTheDocument ( ) ;
233+ expect (
234+ await screen . findByLabelText (
235+ 'The items usage statuses will be updated to In Use, as defined by the rules'
236+ )
237+ ) . toBeInTheDocument ( ) ;
233238
234239 await user . click ( screen . getByRole ( 'button' , { name : 'Move here' } ) ) ;
235240
236241 expect ( axiosPatchSpy ) . toHaveBeenCalledWith ( '/v1/items/KvT2Ox7n' , {
237- system_id : '65328f34a40ff5301575a4e3 ' ,
242+ system_id : '656da8ef9cba7a76c6f81a5d ' ,
238243 usage_status_id : '1' ,
239244 } ) ;
240245 expect ( axiosPatchSpy ) . toHaveBeenCalledWith ( '/v1/items/G463gOIA' , {
241- system_id : '65328f34a40ff5301575a4e3 ' ,
246+ system_id : '656da8ef9cba7a76c6f81a5d ' ,
242247 usage_status_id : '1' ,
243248 } ) ;
244249
245250 expect ( mockOnClose ) . toHaveBeenCalled ( ) ;
246251 expect ( mockOnChangeSelectedItems ) . toHaveBeenCalledWith ( { } ) ;
247252 } , 10000 ) ;
248253
249- it ( 'moves selected systems (to non-root system)' , async ( ) => {
254+ it ( 'moves selected systems (to non-root system with the same system type )' , async ( ) => {
250255 props . parentSystemId = SystemsJSON [ 2 ] . id ;
251256 createView ( ) ;
252257
@@ -257,22 +262,28 @@ describe('SystemItemsDialog', () => {
257262 await user . click ( screen . getByLabelText ( 'navigate to systems home' ) ) ;
258263
259264 await waitFor ( ( ) => {
260- expect ( screen . getByText ( 'Giant laser ' ) ) . toBeInTheDocument ( ) ;
265+ expect ( screen . getByText ( 'Pulse Laser ' ) ) . toBeInTheDocument ( ) ;
261266 } ) ;
262267
263- await user . click ( screen . getByText ( 'Giant laser ' ) ) ;
268+ await user . click ( screen . getByText ( 'Pulse Laser ' ) ) ;
264269
265- await waitFor ( ( ) => {
266- expect ( screen . getByText ( 'Smaller laser' ) ) . toBeInTheDocument ( ) ;
267- } ) ;
270+ expect (
271+ await screen . findByText ( 'Item Moving Rule Applied' )
272+ ) . toBeInTheDocument ( ) ;
273+
274+ expect (
275+ await screen . findByLabelText (
276+ 'The items usage statuses we remain the same, as defined by the rules'
277+ )
278+ ) . toBeInTheDocument ( ) ;
268279
269280 await user . click ( screen . getByRole ( 'button' , { name : 'Move here' } ) ) ;
270281
271282 expect ( axiosPatchSpy ) . toHaveBeenCalledWith ( '/v1/items/KvT2Ox7n' , {
272- system_id : '65328f34a40ff5301575a4e3 ' ,
283+ system_id : '656da8ef9cba7a76c6f81a5d ' ,
273284 } ) ;
274285 expect ( axiosPatchSpy ) . toHaveBeenCalledWith ( '/v1/items/G463gOIA' , {
275- system_id : '65328f34a40ff5301575a4e3 ' ,
286+ system_id : '656da8ef9cba7a76c6f81a5d ' ,
276287 } ) ;
277288
278289 expect ( mockOnClose ) . toHaveBeenCalled ( ) ;
0 commit comments