Fix potential error dragging to library that hasn't been loaded
https://forums.zotero.org/discussion/85136/unable-to-copy-items-between-libraries Zotero.Relations.getByPredicateAndObject() is now async.
This commit is contained in:
parent
42e74fb8cc
commit
8fc316f727
7 changed files with 22 additions and 22 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
describe("Zotero.Relations", function () {
|
||||
describe("#getByPredicateAndObject()", function () {
|
||||
it("should return items matching predicate and object", function* () {
|
||||
it("should return items matching predicate and object", async function () {
|
||||
var item = createUnsavedDataObject('item');
|
||||
item.setRelations({
|
||||
"dc:relation": [
|
||||
|
@ -13,8 +13,8 @@ describe("Zotero.Relations", function () {
|
|||
"http://zotero.org/groups/1/items/GSMRRSSM"
|
||||
]
|
||||
})
|
||||
yield item.saveTx();
|
||||
var objects = Zotero.Relations.getByPredicateAndObject(
|
||||
await item.saveTx();
|
||||
var objects = await Zotero.Relations.getByPredicateAndObject(
|
||||
'item', 'owl:sameAs', 'http://zotero.org/groups/1/items/SRRMGSRM'
|
||||
);
|
||||
assert.lengthOf(objects, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue