Add basic tests for full-text search
- also add importFileAttachment support function
This commit is contained in:
parent
9e573cdce2
commit
aac1255d3d
4 changed files with 96 additions and 1 deletions
|
@ -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});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue