Skip to content

Commit

Permalink
fix: white space regex & pattern unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jayakishore709 committed Jan 7, 2025
1 parent 73aac04 commit d01b6a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion schemas/data/src/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
},
"trim": {
"type": "string",
"pattern": "^([^\\s]+.*|.*[^\\s]+)$",
"pattern": "^(?!\\s).+(?<!\\s)$",
"maxLength": 4000
},
"cr-char": {
Expand Down
4 changes: 2 additions & 2 deletions schemas/data/test/quality-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const checkProperty = (errors, keyword, property) => {
error.instancePath.includes(property)
) {
return true
} else if (keyword === 'pattern') return true
} else if (keyword === 'pattern' && error.instancePath.includes(property)) return true
}
return false
}
Expand Down Expand Up @@ -823,7 +823,7 @@ test('Should accept columns without extra whitespace', async (t) => {
ResultAnalyticalMethodID: 'sum',
ResultAnalyticalMethodName: 'sum',
LaboratoryName: 'sum',
LaboratorySampleID: 'sum'
LaboratorySampleID: 'A'
})
t.is(valid, true)
})

0 comments on commit d01b6a6

Please sign in to comment.