@@ -266,21 +266,40 @@ describe('getOperationNotAllowedMessage', () => {
266266
267267describe ( 'getOperationNotPermittedMessage' , ( ) => {
268268 test ( 'no statusData' , ( ) => {
269- expect ( getOperationNotPermittedMessage ( undefined ) ) . toBeNull ( ) ;
269+ expect ( getOperationNotPermittedMessage ( undefined , 'sample' , 'samples' , 1 ) ) . toBeNull ( ) ;
270270 } ) ;
271271
272272 test ( 'no notPermitted' , ( ) => {
273- expect ( getOperationNotPermittedMessage ( new OperationConfirmationData ( { notPermitted : undefined } ) ) ) . toBeNull ( ) ;
274- expect ( getOperationNotPermittedMessage ( new OperationConfirmationData ( { notPermitted : [ ] } ) ) ) . toBeNull ( ) ;
273+ expect (
274+ getOperationNotPermittedMessage (
275+ new OperationConfirmationData ( { notPermitted : undefined } ) ,
276+ 'sample' ,
277+ 'samples' ,
278+ 1
279+ )
280+ ) . toBeNull ( ) ;
281+ expect (
282+ getOperationNotPermittedMessage ( new OperationConfirmationData ( { notPermitted : [ ] } ) , 'sample' , 'samples' , 1 )
283+ ) . toBeNull ( ) ;
275284 } ) ;
276285
277286 test ( 'with notPermitted' , ( ) => {
278- expect ( getOperationNotPermittedMessage ( new OperationConfirmationData ( { notPermitted : [ 1 ] } ) ) ) . toBe (
279- 'The selection includes 1 sample that you do not have permission to edit. Updates will only be made to the samples you have edit permission for.'
280- ) ;
281- expect ( getOperationNotPermittedMessage ( new OperationConfirmationData ( { notPermitted : [ 1 , 2 ] } ) ) ) . toBe (
282- 'The selection includes 2 samples that you do not have permission to edit. Updates will only be made to the samples you have edit permission for.'
283- ) ;
287+ expect (
288+ getOperationNotPermittedMessage (
289+ new OperationConfirmationData ( { notPermitted : [ 1 ] } ) ,
290+ 'sample' ,
291+ 'samples' ,
292+ 1
293+ )
294+ ) . toBe ( 'You do not have permission to edit the selected sample.' ) ;
295+ expect (
296+ getOperationNotPermittedMessage (
297+ new OperationConfirmationData ( { notPermitted : [ 1 , 2 ] } ) ,
298+ 'sample' ,
299+ 'samples' ,
300+ 2
301+ )
302+ ) . toBe ( 'You do not have permission to edit any of the selected samples.' ) ;
284303 } ) ;
285304} ) ;
286305
0 commit comments