summaryrefslogtreecommitdiffstats
path: root/lib/utils/__tests__/location.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-05-03 12:10:09 +0200
committerSamy Pessé <samypesse@gmail.com>2016-05-03 12:10:09 +0200
commitc84eaa83dd3bf307d5cc35b01febb2b6cc6ffbab (patch)
treef65d81365e10ccd831455df300db3e8c4086a9a8 /lib/utils/__tests__/location.js
parent6b17d08892828818216a260576c83b7203c2098f (diff)
parent74c3ff80cbc64eb4fb4252ca4cc08076d44c6be2 (diff)
downloadgitbook-c84eaa83dd3bf307d5cc35b01febb2b6cc6ffbab.zip
gitbook-c84eaa83dd3bf307d5cc35b01febb2b6cc6ffbab.tar.gz
gitbook-c84eaa83dd3bf307d5cc35b01febb2b6cc6ffbab.tar.bz2
Merge pull request #1259 from GitbookIO/png-data-uri
Adding data-uri support for PNG Images in Books
Diffstat (limited to 'lib/utils/__tests__/location.js')
-rw-r--r--lib/utils/__tests__/location.js9
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() {