-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72795f2
commit b07cb7e
Showing
4 changed files
with
36 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,37 @@ | ||
import { urlValidation, tokenValidation } from './validation'; | ||
|
||
describe('validation', () => { | ||
describe('urlValidation', () => { | ||
it('should return true when url valid', async () => { | ||
const result = await urlValidation('http://valid.url'); | ||
expect(result).toBe(true); | ||
}); | ||
|
||
it('should return false when url invalid', async () => { | ||
const result = await urlValidation('invalid.url'); | ||
expect(result).toBe(false); | ||
}); | ||
|
||
it('should return false when url is null', async () => { | ||
const result = await urlValidation(null); | ||
expect(result).toBe(false); | ||
}); | ||
describe('urlValidation', () => { | ||
it('should return true when url valid', async () => { | ||
const result = await urlValidation('http://valid.url'); | ||
expect(result).toBe(true); | ||
}); | ||
|
||
}) | ||
it('should return false when url invalid', async () => { | ||
const result = await urlValidation('invalid.url'); | ||
expect(result).toBe(false); | ||
}); | ||
|
||
describe('tokenValidation', () => { | ||
it('should return true when token valid', async () => { | ||
const result = await tokenValidation('abcdef'); | ||
expect(result).toBe(true); | ||
}); | ||
|
||
it('should return false when token too short', async () => { | ||
const result = await tokenValidation('a'); | ||
expect(result).toBe(false); | ||
}); | ||
it('should return false when url is null', async () => { | ||
const result = await urlValidation(null); | ||
expect(result).toBe(false); | ||
}); | ||
}); | ||
|
||
it('should return false when token too long', async () => { | ||
const result = await tokenValidation('123456789'); | ||
expect(result).toBe(false); | ||
}); | ||
}); | ||
describe('tokenValidation', () => { | ||
it('should return true when token valid', async () => { | ||
const result = await tokenValidation('abcdef'); | ||
expect(result).toBe(true); | ||
}); | ||
|
||
it('should return false when token too short', async () => { | ||
const result = await tokenValidation('a'); | ||
expect(result).toBe(false); | ||
}); | ||
|
||
it('should return false when token too long', async () => { | ||
const result = await tokenValidation('123456789'); | ||
expect(result).toBe(false); | ||
}); | ||
}); | ||
}); |