-
Notifications
You must be signed in to change notification settings - Fork 57
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
cad5b19
commit e128460
Showing
1 changed file
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-env mocha */ | ||
|
||
describe('Util', function () { | ||
it('should include the token in the sprite URL when the the URL does not start with http', function () { | ||
const spriteUrl = "../sprites/sprite" | ||
const token = "asdf"; | ||
|
||
const style = L.esri.Vector.Util.formatStyle({"version":8,"sprite":spriteUrl,"glyphs":"../fonts/{fontstack}/{range}.pbf","sources":{"esri":{"type":"vector","attribution":"test","bounds":[-180,-85.0511,180,85.0511],"minzoom":0,"maxzoom":19,"scheme":"xyz","url":"../../"}},"layers":[]}, "nope", {}, token); | ||
|
||
expect(style.sprite).to.equal(`${spriteUrl}?token=${token}`); | ||
}); | ||
|
||
it('should include the token in the sprite URL when the the URL does start with http', function () { | ||
const spriteUrl = "https://www.arcgis.com/sharing/rest/content/items/123456789/resources/sprites/sprite-1679474043120" | ||
const token = "asdf"; | ||
|
||
const style = L.esri.Vector.Util.formatStyle({"version":8,"sprite":spriteUrl,"glyphs":"../fonts/{fontstack}/{range}.pbf","sources":{"esri":{"type":"vector","attribution":"test","bounds":[-180,-85.0511,180,85.0511],"minzoom":0,"maxzoom":19,"scheme":"xyz","url":"../../"}},"layers":[]}, "nope", {}, token); | ||
|
||
expect(style.sprite).to.equal(`${spriteUrl}?token=${token}`); | ||
}); | ||
}); |