mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: add category search test, #9307
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user