-
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.
Moved utils.js tests into separate file
- Loading branch information
1 parent
9bd3759
commit b4d3c1e
Showing
3 changed files
with
10 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const utils = require('./utils'); | ||
|
||
test('trancate long selector to get safe-length url', () => { | ||
const baseUrl = 'base_url'; | ||
const longSelector = '.very .long .selector '.repeat(1000); | ||
const result = utils.getSafeUrl(baseUrl, longSelector); | ||
|
||
expect(result).toBe(`${baseUrl}?${longSelector}`.substring(0, utils.MAX_URL_LENGTH)); | ||
}); |