Add "Manage Styles…" link to Create Bib and Doc Prefs windows

Clicking it cancels the current window, opens the Cite pane of the
prefs, and selects the Styles tab. (This will be more useful once we
have inline style installation from that pane.)
This commit is contained in:
Dan Stillman 2016-09-06 17:59:55 -04:00
parent 0828d4d5e9
commit 474420620e
7 changed files with 75 additions and 2 deletions

View file

@ -0,0 +1,45 @@
"use strict";
describe("Create Bibliography Dialog", function () {
var win, zp;
before(function* () {
win = yield loadZoteroPane();
zp = win.ZoteroPane;
});
after(function () {
win.close();
});
it("should perform a search", function* () {
yield Zotero.Styles.init();
var item = yield createDataObject('item');
var deferred = Zotero.Promise.defer();
var called = false;
waitForWindow("chrome://zotero/content/bibliography.xul", function (dialog) {
waitForWindow("chrome://zotero/content/preferences/preferences.xul", function (window) {
// Wait for pane switch
Zotero.Promise.coroutine(function* () {
do {
Zotero.debug("Checking for pane");
yield Zotero.Promise.delay(5);
}
while (window.document.documentElement.currentPane.id != 'zotero-prefpane-cite');
let pane = window.document.documentElement.currentPane;
assert.equal(pane.getElementsByTagName('tabbox')[0].selectedTab.id, 'styles-tab');
assert.equal(pane.getElementsByTagName('tabbox')[0].selectedPanel.id, 'styles');
called = true;
window.close();
deferred.resolve();
})();
});
dialog.document.getElementById('manage-styles').click();
});
win.Zotero_File_Interface.bibliographyFromItems();
yield deferred.promise;
assert.ok(called);
});
});