Changes imports from connector to save to selected collection

Closes #1289
This commit is contained in:
Adomas Venčkauskas 2017-08-15 11:14:50 +03:00
parent cee2e1d47a
commit a5a7df328a
2 changed files with 14 additions and 2 deletions

View file

@ -513,7 +513,11 @@ describe("Connector Server", function () {
assert.equal(error.xmlhttp.status, 400);
});
it('should import resources (BibTeX)', function* () {
it('should import resources (BibTeX) into selected collection', function* () {
var collection = yield createDataObject('collection');
yield waitForItemsLoad(win);
var addedItemIDPromise = waitForItemEvent('add');
var resource = `@book{test1,
title={Test1},
author={Owl},
@ -530,6 +534,9 @@ describe("Connector Server", function () {
);
assert.equal(response.status, 201);
assert.equal(JSON.parse(response.responseText)[0].title, 'Test1');
let itemId = yield addedItemIDPromise;
assert.isTrue(collection.hasItem(itemId[0]));
});
});
});