mirror of
https://github.com/zotero/zotero.git
synced 2026-09-16 23:41:08 +00:00
And:
- Use a different port for tests so server tests don't break when Zotero
is already running
- Remove no-op httpServer.enabled pref updates in tests
- It's already enabled, no test disables it, and any test that did
would clean up after itself
- Updating that pref has no effect without a separate call to
Zotero.Server.init()
- Remove unused arg to Zotero.Server.init()
32 lines
846 B
JavaScript
32 lines
846 B
JavaScript
"use strict";
|
|
|
|
describe("MacOS Integration Server", function () {
|
|
var serverURL;
|
|
|
|
before(function* () {
|
|
this.timeout(20000);
|
|
yield resetDB({
|
|
thisArg: this,
|
|
skipBundledFiles: true
|
|
});
|
|
|
|
serverURL = `http://127.0.0.1:${Zotero.Server.port}/integration`;
|
|
});
|
|
|
|
describe('/integration/macWordCommand', function () {
|
|
it('should call Integration.execCommand with passed parameters', async function () {
|
|
let stub = sinon.stub(Zotero.Integration, 'execCommand');
|
|
try {
|
|
await Zotero.HTTP.request(
|
|
'GET',
|
|
`${serverURL}/macWordCommand?agent=httpTest&command=httpTestCommand&document=docName&templateVersion=-1`,
|
|
);
|
|
|
|
assert.isTrue(stub.calledOnce);
|
|
assert.isTrue(stub.firstCall.calledWithExactly('httpTest', 'httpTestCommand', 'docName', '-1'));
|
|
} finally {
|
|
stub.restore();
|
|
}
|
|
});
|
|
});
|
|
});
|