Skip to content

Commit

Permalink
feat: category search test
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Feb 19, 2021
1 parent ed3d9dc commit a592ebd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ describe('Search', () => {
assert.strictEqual(result.categories[0].name, 'baz category');
});

it('should search for categories', async () => {
const socketCategories = require('../src/socket.io/categories');
let data = await socketCategories.categorySearch({ uid: phoebeUid }, { query: 'baz', parentCid: 0 });
assert.strictEqual(data[0].name, 'baz category');
data = await socketCategories.categorySearch({ uid: phoebeUid }, { query: '', parentCid: 0 });
assert.strictEqual(data.length, 5);
});

it('should fail if searchIn is wrong', (done) => {
search.search({
query: 'plug',
Expand Down

0 comments on commit a592ebd

Please sign in to comment.