Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardosfl committed Aug 3, 2020
1 parent 8ddd1e1 commit 930e111
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test-search-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ describe('search utils', () => {
);
});

it('should allow multiple terms to be used', () => {
const ui = createPreprintQs({ text: ['text1', 'text2'] });

assert.equal(ui, '?q=text1&q=text2');

const p = querystring.parse(apifyPreprintQs(ui).substring(1));
assert.equal(p.q, '(name:"text1" OR name:text1* OR name:"text2" OR name:text2*)' );
});

it('should handle DOI and arXivId', () => {
const ui = createPreprintQs({
text: `text ${arXivId} ${crossrefDoi} ${openAireDoi}`
Expand Down

0 comments on commit 930e111

Please sign in to comment.