Relax HTML checking in SingleFile tests

Somehow the saved page starts with "<html style>" instead of "<html>" on
GitHub Actions
This commit is contained in:
Dan Stillman 2021-01-18 03:52:00 -05:00
parent 649d70eeda
commit 4c048f6fd2

View file

@ -362,7 +362,7 @@ describe("Zotero.Attachments", function() {
let path = OS.Path.join(storageDir, 'index.html');
assert.isTrue(await OS.File.exists(path));
let contents = await Zotero.File.getContentsAsync(path);
assert.isTrue(contents.startsWith("<html><!--\n Page saved with SingleFile"));
assert.include(contents, "><!--\n Page saved with SingleFile");
// Check attachment base64 contents
let expectedPath = getTestDataDirectory();
@ -408,7 +408,7 @@ describe("Zotero.Attachments", function() {
let path = OS.Path.join(storageDir, 'index.html');
assert.isTrue(await OS.File.exists(path));
let contents = await Zotero.File.getContentsAsync(path);
assert.include(contents, "<html><!--\n Page saved with SingleFile");
assert.include(contents, "><!--\n Page saved with SingleFile");
// Check attachment base64 contents
let expectedPath = getTestDataDirectory();
@ -460,7 +460,7 @@ describe("Zotero.Attachments", function() {
let path = OS.Path.join(storageDir, 'index.html');
assert.isTrue(await OS.File.exists(path));
let contents = await Zotero.File.getContentsAsync(path);
assert.include(contents, "<html><!--\n Page saved with SingleFile");
assert.include(contents, "><!--\n Page saved with SingleFile");
});
it("should save a document but not save the iframe", async function () {