diff options
author | Johan Preynat <johan.preynat@gmail.com> | 2016-05-03 11:27:36 +0200 |
---|---|---|
committer | Johan Preynat <johan.preynat@gmail.com> | 2016-05-03 11:27:36 +0200 |
commit | 8c4752c5d8e407a2822386710f43d5c34a65f84b (patch) | |
tree | 97886993c17b40dfb6d9cc1bc250bdbfa38598b0 /lib | |
parent | d6202e522b7875546bfcd6ed000a72d1910fade4 (diff) | |
download | gitbook-8c4752c5d8e407a2822386710f43d5c34a65f84b.zip gitbook-8c4752c5d8e407a2822386710f43d5c34a65f84b.tar.gz gitbook-8c4752c5d8e407a2822386710f43d5c34a65f84b.tar.bz2 |
lib/utils/__tests__/location.js: Add location.isDataURI() test file
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/__tests__/location.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/utils/__tests__/location.js b/lib/utils/__tests__/location.js index f2037ff..1d75751 100644 --- a/lib/utils/__tests__/location.js +++ b/lib/utils/__tests__/location.js @@ -9,6 +9,15 @@ describe('LocationUtils', function() { expect(LocationUtils.isExternal('test.md')).toBe(false); expect(LocationUtils.isExternal('folder/test.md')).toBe(false); expect(LocationUtils.isExternal('/folder/test.md')).toBe(false); + expect(LocationUtils.isExternal('data:image/png')).toBe(false); + }); + + it('should correctly test data:uri location', function() { + expect(LocationUtils.isDataURI('data:image/png')).toBe(true); + expect(LocationUtils.isDataURI('http://google.fr')).toBe(false); + expect(LocationUtils.isDataURI('https://google.fr')).toBe(false); + expect(LocationUtils.isDataURI('test.md')).toBe(false); + expect(LocationUtils.isDataURI('data.md')).toBe(false); }); it('should correctly detect anchor location', function() { |