diff --git a/tests/remote_js/test/3/itemTest.js b/tests/remote_js/test/3/itemTest.js index 7c3b7536..38cc4490 100644 --- a/tests/remote_js/test/3/itemTest.js +++ b/tests/remote_js/test/3/itemTest.js @@ -1465,6 +1465,25 @@ describe('ItemsTests', function () { Helpers.assertEquals("aaa", json[0].data.title); }); + it('test_unfiled', async function () { + await API.userClear(config.userID); + + let collectionKey = await API.createCollection('Test', false, this, 'key'); + await API.createItem("book", { title: 'aaa' }, this, 'key'); + await API.createItem("book", { title: 'bbb' }, this, 'key'); + + await API.createItem("book", { title: 'ccc', collections: [collectionKey] }, this, 'key'); + let parentBookInCollection = await API.createItem("book", { title: 'ddd', collections: [collectionKey] }, this, 'key'); + await API.createNoteItem("some note", parentBookInCollection, this, 'key'); + + let response = await API.userGet(config.userID, `items/unfiled?sort=title`); + Helpers.assert200(response); + Helpers.assertNumResults(response, 2); + let json = API.getJSONFromResponse(response); + Helpers.assertEquals("aaa", json[0].data.title); + Helpers.assertEquals("bbb", json[1].data.title); + }); + /** * Date Modified shouldn't be changed if 1) dateModified is provided or 2) certain fields are changed */ diff --git a/tests/remote_js/test/3/tagTest.js b/tests/remote_js/test/3/tagTest.js index 2fb61985..a2b16776 100644 --- a/tests/remote_js/test/3/tagTest.js +++ b/tests/remote_js/test/3/tagTest.js @@ -819,4 +819,26 @@ describe('TagTests', function () { tags.slice(1) ); }); + + it('tests_unfiled_tags', async function () { + await API.userClear(config.userID); + + let collectionKey = await API.createCollection('Test', false, this, 'key'); + await API.createItem("book", { title: 'aaa', tags: [{ tag: "unfiled" }] }, this, 'key'); + await API.createItem("book", { title: 'bbb', tags: [{ tag: "unfiled" }] }, this, 'key'); + + await API.createItem("book", { title: 'ccc', collections: [collectionKey], tags: [{ tag: "filed" }] }, this, 'key'); + let parentBookInCollection = await API.createItem("book", + { title: 'ddd', + collections: [collectionKey], + tags: [{ tag: "also_filed" }] }, + this, 'key'); + await API.createNoteItem("some note", parentBookInCollection, this, 'key'); + + let response = await API.userGet(config.userID, `items/unfiled/tags`); + Helpers.assert200(response); + Helpers.assertNumResults(response, 1); + let json = API.getJSONFromResponse(response); + Helpers.assertEquals("unfiled", json[0].tag); + }); });