@@ -320,7 +320,7 @@ describe('Validation', () => {
320
320
expect ( isValid ) . toStrictEqual ( 'invalidAcasNumber' ) ;
321
321
} ) ;
322
322
323
- it ( 'Should check if value starts with R' , ( ) => {
323
+ it ( 'Should check if value starts with R or MU ' , ( ) => {
324
324
const beginsWithT = isAcasNumberValid ( 'T123458/89/13' ) ;
325
325
const beginsWithQ = isAcasNumberValid ( 'q123456/78/12' ) ;
326
326
const beginsWithDigit = isAcasNumberValid ( '1234556/79/12' ) ;
@@ -330,10 +330,12 @@ describe('Validation', () => {
330
330
expect ( beginsWithDigit ) . toStrictEqual ( 'invalidAcasNumber' ) ;
331
331
} ) ;
332
332
333
- it ( 'Should check if has any numeric or / character after R' , ( ) => {
334
- const isValid = isAcasNumberValid ( 'R12345/789a12' ) ;
333
+ it ( 'Should check if has any numeric or / character after R or MU' , ( ) => {
334
+ const invalidAfterR = isAcasNumberValid ( 'R12345/789a12' ) ;
335
+ const invalidAfterMU = isAcasNumberValid ( 'MU12345/789a12' ) ;
335
336
336
- expect ( isValid ) . toStrictEqual ( 'invalidAcasNumber' ) ;
337
+ expect ( invalidAfterR ) . toStrictEqual ( 'invalidAcasNumber' ) ;
338
+ expect ( invalidAfterMU ) . toStrictEqual ( 'invalidAcasNumber' ) ;
337
339
} ) ;
338
340
339
341
it ( 'Should check if has any repeating / character like //' , ( ) => {
@@ -386,10 +388,33 @@ describe('Validation', () => {
386
388
expect ( isValid ) . toStrictEqual ( undefined ) ;
387
389
} ) ;
388
390
389
- it ( 'Should validate corect RNNNNNN/NN/NN format' , ( ) => {
391
+ it ( 'Should allow MU prefix in any case' , ( ) => {
392
+ const mu = isAcasNumberValid ( 'MU123456/78/12' ) ;
393
+ const Mu = isAcasNumberValid ( 'Mu123456/78/12' ) ;
394
+ const mU = isAcasNumberValid ( 'mU123456/78/12' ) ;
395
+ const muLower = isAcasNumberValid ( 'mu123456/78/12' ) ;
396
+ expect ( mu ) . toStrictEqual ( undefined ) ;
397
+ expect ( Mu ) . toStrictEqual ( undefined ) ;
398
+ expect ( mU ) . toStrictEqual ( undefined ) ;
399
+ expect ( muLower ) . toStrictEqual ( undefined ) ;
400
+ } ) ;
401
+
402
+ it ( 'Should reject RU and RMU prefixes' , ( ) => {
403
+ const ru = isAcasNumberValid ( 'RU123456/78/12' ) ;
404
+ const rmu = isAcasNumberValid ( 'RMU123456/78/12' ) ;
405
+ expect ( ru ) . toStrictEqual ( 'invalidAcasNumber' ) ;
406
+ expect ( rmu ) . toStrictEqual ( 'invalidAcasNumber' ) ;
407
+ } ) ;
408
+
409
+ it ( 'Should validate correct RNNNNNN/NN/NN format' , ( ) => {
390
410
const isValid = isAcasNumberValid ( 'R123456/78/12' ) ;
391
411
expect ( isValid ) . toStrictEqual ( undefined ) ;
392
412
} ) ;
413
+
414
+ it ( 'Should validate correct MUNNNNNN/NN/NN format' , ( ) => {
415
+ const isValid = isAcasNumberValid ( 'MU123456/78/12' ) ;
416
+ expect ( isValid ) . toStrictEqual ( undefined ) ;
417
+ } ) ;
393
418
} ) ;
394
419
describe ( 'isContent100CharsOrLess()' , ( ) => {
395
420
it ( 'should not warn when content is 100 characters or less' , ( ) => {
0 commit comments