Disallow inPublications for linked-file attachments
This commit is contained in:
parent
d715197b2f
commit
9bd01af2a5
2 changed files with 20 additions and 3 deletions
|
@ -363,7 +363,19 @@ describe("Zotero.Item", function () {
|
|||
"SELECT COUNT(*) FROM publicationsItems WHERE itemID=?", item.id)),
|
||||
0
|
||||
);
|
||||
})
|
||||
});
|
||||
|
||||
it("should be invalid for linked-file attachments", function* () {
|
||||
var item = yield createDataObject('item', { inPublications: true });
|
||||
var attachment = yield Zotero.Attachments.linkFromFile({
|
||||
file: OS.Path.join(getTestDataDirectory().path, 'test.png'),
|
||||
parentItemID: item.id
|
||||
});
|
||||
attachment.inPublications = true;
|
||||
var e = yield getPromiseError(attachment.saveTx());
|
||||
assert.ok(e);
|
||||
assert.include(e.message, "Linked-file attachments cannot be added to My Publications");
|
||||
});
|
||||
});
|
||||
|
||||
describe("#parentID", function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue