2015-07-04 02:06:12 +00:00
|
|
|
describe("Zotero.QuickCopy", function() {
|
|
|
|
var quickCopyPref = Zotero.Prefs.get("export.quickCopy.setting");
|
|
|
|
quickCopyPref = JSON.stringify(Zotero.QuickCopy.unserializeSetting(quickCopyPref));
|
|
|
|
|
|
|
|
// TODO: These should set site-specific prefs and test the actual response against it,
|
|
|
|
// but that will need to wait for 5.0. For now, just make sure they don't fail.
|
|
|
|
describe("#getFormatFromURL()", function () {
|
2015-07-04 02:14:08 +00:00
|
|
|
it("should handle an HTTP URL", function () {
|
2015-07-04 02:06:12 +00:00
|
|
|
assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo.com/'), quickCopyPref);
|
|
|
|
})
|
|
|
|
|
2015-07-04 02:14:08 +00:00
|
|
|
it("should handle an HTTPS URL", function () {
|
|
|
|
assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('https://foo.com/'), quickCopyPref);
|
|
|
|
})
|
|
|
|
|
2015-07-04 02:06:12 +00:00
|
|
|
it("should handle a domain and path", function () {
|
|
|
|
assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo.com/bar'), quickCopyPref);
|
|
|
|
})
|
|
|
|
|
|
|
|
it("should handle a local host", function () {
|
|
|
|
assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo/'), quickCopyPref);
|
|
|
|
})
|
|
|
|
|
2015-07-04 03:46:39 +00:00
|
|
|
it("should handle a domain with a trailing period", function () {
|
|
|
|
assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo.com.'), quickCopyPref);
|
|
|
|
})
|
|
|
|
|
2015-07-04 02:06:12 +00:00
|
|
|
it("should handle an about: URL", function () {
|
|
|
|
assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('about:blank'), quickCopyPref);
|
|
|
|
})
|
|
|
|
|
|
|
|
it("should handle a chrome URL", function () {
|
|
|
|
assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('chrome://zotero/content/tab.xul'), quickCopyPref);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|