Add basic tests for full-text search

- also add importFileAttachment support function
This commit is contained in:
Erik Hetzner 2015-05-31 14:39:37 -07:00
parent 9e573cdce2
commit aac1255d3d
4 changed files with 96 additions and 1 deletions

View file

@ -241,4 +241,17 @@ function resetDB() {
}).then(function() {
return Zotero.Schema.schemaUpdatePromise;
});
}
}
/**
* Imports an attachment from a test file.
* @param {string} filename - The filename to import (in data directory)
* @return {Promise<Zotero.Item>}
*/
function importFileAttachment(filename) {
let testfile = getTestDataDirectory();
filename.split('/').forEach((part) => testfile.append(part));
return Zotero.Attachments.importFromFile({file: testfile});
}