File tree Expand file tree Collapse file tree
application/CohortManager/src/Web/app/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ describe("ruleMapping", () => {
2020 expect ( mapping ) . toHaveProperty ( "reportingId" ) ;
2121 expect ( typeof mapping . ruleDescription ) . toBe ( "string" ) ;
2222 expect ( mapping . ruleDescription . length ) . toBeGreaterThan ( 0 ) ;
23- expect ( typeof mapping . reportingId ) . toBe ( "string" ) ;
23+ expect ( [ "string" , "undefined" ] ) . toContain ( typeof mapping . reportingId ) ;
2424 if ( mapping . reportingId ) {
2525 expect ( mapping . reportingId . length ) . toBeGreaterThan ( 0 ) ;
2626 }
@@ -143,9 +143,11 @@ describe("ruleMapping", () => {
143143
144144 describe ( "specific rule validations" , ( ) => {
145145 it ( "should have correct CMR reporting IDs format" , ( ) => {
146- Object . values ( ruleIdMappings ) . forEach ( ( mapping ) => {
147- expect ( mapping . reportingId ) . toMatch ( / ^ C M R \d + $ / ) ;
148- } ) ;
146+ Object . values ( ruleIdMappings )
147+ . filter ( ( mapping ) => mapping . reportingId !== undefined )
148+ . forEach ( ( mapping ) => {
149+ expect ( mapping . reportingId ) . toMatch ( / ^ C M R \d + $ / ) ;
150+ } ) ;
149151 } ) ;
150152
151153 it ( "should have non-empty rule descriptions" , ( ) => {
You can’t perform that action at this time.
0 commit comments