feat: add category search test, #9307

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 25c8f02634
commit bbaaead09c

@ -155,6 +155,23 @@ describe('Search', () => {
});
});
it('should search for a category', async () => {
await categories.create({
name: 'foo category',
description: 'Test category created by testing script',
});
await categories.create({
name: 'baz category',
description: 'Test category created by testing script',
});
const result = await search.search({
query: 'baz',
searchIn: 'categories',
});
assert.strictEqual(result.matchCount, 1);
assert.strictEqual(result.categories[0].name, 'baz category');
});
it('should fail if searchIn is wrong', (done) => {
search.search({
query: 'plug',

Loading…
Cancel
Save