From 5730bf690e7d8cfaf541e436ba993cbea5f7df19 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 5 Dec 2023 06:52:20 -0500 Subject: [PATCH] fx115: Don't try to spy on IOUtils function in test Since it doesn't work --- test/tests/zoteroPaneTest.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/tests/zoteroPaneTest.js b/test/tests/zoteroPaneTest.js index 0bb9a34fb8..3b6ed2e21d 100644 --- a/test/tests/zoteroPaneTest.js +++ b/test/tests/zoteroPaneTest.js @@ -1434,19 +1434,21 @@ describe("ZoteroPane", function() { let dialogStub = sinon.stub(zp, 'showLinkedFileFoundAutomaticallyDialog') .returns('one'); - let existsSpy = sinon.spy(OS.File, 'exists'); + // No longer works with IOUtils + //let existsSpy = sinon.spy(IOUtils, 'exists'); await zp.checkForLinkedFilesToRelink(attachment); assert.ok(dialogStub.calledOnce); assert.ok(dialogStub.calledWith(attachment, sinon.match.string, 0)); - assert.ok(existsSpy.calledWith(OS.Path.join(labdSubdir, 'test.pdf'))); - assert.notOk(existsSpy.calledWith(OS.Path.join(labdDir, 'test.pdf'))); // Should never get there + //Zotero.debug(existsSpy.calledWith(OS.Path.join(labdSubdir, 'test.pdf'))); + //assert.ok(existsSpy.calledWith(OS.Path.join(labdSubdir, 'test.pdf'))); + //assert.notOk(existsSpy.calledWith(OS.Path.join(labdDir, 'test.pdf'))); // Should never get there await assert.eventually.isTrue(attachment.fileExists()); assert.equal(attachment.getFilePath(), labdFile); assert.equal(attachment.attachmentPath, 'attachments:subdir/test.pdf'); dialogStub.restore(); - existsSpy.restore(); + //existsSpy.restore(); }); it("should handle Windows paths", async function () {