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