Skip to content

Commit

Permalink
#944 Fixed unit test to take a string not a dictonary
Browse files Browse the repository at this point in the history
  • Loading branch information
david-rocca committed Nov 17, 2023
1 parent 68c4a11 commit 44ce92b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/unit-tests/middleware/checkForInvalidCharacters.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ describe('Testing Invalid Character checker', () => {
context('negative tests', () => {
it('Should fail when detecting a >', async () => {
try {
containsNoInvalidCharacters({ key: 'sa>fe' })
containsNoInvalidCharacters('sa>fe')
} catch (err) {
expect(err.message).to.contain('contains invalid character: >')
}
})
it('Should fail when detecting a <', async () => {
try {
containsNoInvalidCharacters({ key: 'sa<fe' })
containsNoInvalidCharacters('sa<fe')
} catch (err) {
expect(err.message).to.contain('contains invalid character: <')
}
})
it('Should fail when detecting a "', async () => {
try {
containsNoInvalidCharacters({ key: 'sa"fe' })
containsNoInvalidCharacters('sa"fe')
} catch (err) {
expect(err.message).to.contain('contains invalid character: "')
}
})
})
context('positive test', () => {
it('Should pass if no invalid characters', async () => {
containsNoInvalidCharacters({ key: 'safe' })
containsNoInvalidCharacters('safe')
})
})
})

0 comments on commit 44ce92b

Please sign in to comment.