Fix Quick Copy in tab mode, but for real
This commit is contained in:
parent
20f279043b
commit
242581a270
2 changed files with 38 additions and 4 deletions
28
test/tests/quickCopyTest.js
Normal file
28
test/tests/quickCopyTest.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
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 () {
|
||||
it("should handle a domain", function () {
|
||||
assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('http://foo.com/'), quickCopyPref);
|
||||
})
|
||||
|
||||
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);
|
||||
})
|
||||
|
||||
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);
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue