www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit e3033b056eeb1ee4d41680a673efb053f600bfed
parent 18349b22322f7fd763777f152a8fe037d1a7c3e8
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed,  9 Dec 2015 04:51:48 -0500

Fix intermittent error in FullText.getUnsyncedContent() test

Diffstat:
Mtest/tests/fulltextTest.js | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/test/tests/fulltextTest.js b/test/tests/fulltextTest.js @@ -128,10 +128,12 @@ describe("Zotero.Fulltext", function () { var data = yield Zotero.FullText.getUnsyncedContent(Zotero.Libraries.userLibraryID); assert.lengthOf(data, 3); - for (let i = toSync.length - 1; i >= 0 ; i--) { - assert.equal(data[i].content, toSync[i].content); - assert.equal(data[i].indexedChars, toSync[i].indexedChars); - assert.equal(data[i].indexedPages, toSync[i].indexedPages); + let contents = toSync.map(x => x.content); + for (let d of data) { + let pos = contents.indexOf(d.content); + assert.isAbove(pos, -1); + assert.equal(d.indexedChars, toSync[pos].indexedChars); + assert.equal(d.indexedPages, toSync[pos].indexedPages); } }) })