Untitled
unknown
javascript
10 months ago
847 B
5
Indexable
// *********************************************************
// ******************* NHI tests **********************
// *********************************************************
test("NHI is unique and is not empty", function() {
const responseData = res.getBody();
expect(responseData).to.not.contain("Patient already exists");
});
test("NHI has the right about of uppercase letters and numbers", function() {
const requestData = req.getBody().HospitalNumber;
const regexForNHI = new RegExp("([A-Z]{3})([0-9]{4})");
expect(requestData).to.match(regexForNHI);
});
test("NHI does not contain special characters", function() {
const requestData = req.getBody().HospitalNumber;
const noSpecialCharsRegex = new RegExp("[!-\/:-@[-`{-~]")
expect(requestData).to.not.match(noSpecialCharsRegex);
});
Editor is loading...
Leave a Comment