* Update CHANGELOG.md * fix : able to search all channels * add chennel/search test * update Changelog --------- Co-authored-by: tamaina <tamaina@hotmail.co.jp> Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> Co-authored-by: atsuchan <83960488+atsu1125@users.noreply.github.com> Co-authored-by: Masaya Suzuki <15100604+massongit@users.noreply.github.com> Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com> Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com> Co-authored-by: xianon <xianon@hotmail.co.jp> Co-authored-by: kabo2468 <28654659+kabo2468@users.noreply.github.com> Co-authored-by: YS <47836716+yszkst@users.noreply.github.com> Co-authored-by: Khsmty <me@khsmty.com> Co-authored-by: Soni L <EnderMoneyMod@gmail.com> Co-authored-by: mei23 <m@m544.net> Co-authored-by: daima3629 <52790780+daima3629@users.noreply.github.com> Co-authored-by: Windymelt <1113940+windymelt@users.noreply.github.com> Co-authored-by: Ebise Lutica <7106976+EbiseLutica@users.noreply.github.com>
This commit is contained in:
parent
8c70bbe74d
commit
8dab46470e
4 changed files with 106 additions and 8 deletions
|
@ -403,6 +403,100 @@ describe('Endpoints', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('channels/search', () => {
|
||||
test('空白検索で一覧を取得できる', async () => {
|
||||
await api('/channels/create', {
|
||||
name: 'aaa',
|
||||
description: 'bbb',
|
||||
}, bob);
|
||||
await api('/channels/create', {
|
||||
name: 'ccc1',
|
||||
description: 'ddd1',
|
||||
}, bob);
|
||||
await api('/channels/create', {
|
||||
name: 'ccc2',
|
||||
description: 'ddd2',
|
||||
}, bob);
|
||||
|
||||
const res = await api('/channels/search', {
|
||||
query: '',
|
||||
}, bob);
|
||||
|
||||
assert.strictEqual(res.status, 200);
|
||||
assert.strictEqual(typeof res.body === 'object' && Array.isArray(res.body), true);
|
||||
assert.strictEqual(res.body.length, 3);
|
||||
});
|
||||
test('名前のみの検索で名前を検索できる', async () => {
|
||||
const res = await api('/channels/search', {
|
||||
query: 'aaa',
|
||||
type: 'nameOnly',
|
||||
}, bob);
|
||||
|
||||
assert.strictEqual(res.status, 200);
|
||||
assert.strictEqual(typeof res.body === 'object' && Array.isArray(res.body), true);
|
||||
assert.strictEqual(res.body.length, 1);
|
||||
assert.strictEqual(res.body[0].name, 'aaa');
|
||||
});
|
||||
test('名前のみの検索で名前を複数検索できる', async () => {
|
||||
const res = await api('/channels/search', {
|
||||
query: 'ccc',
|
||||
type: 'nameOnly',
|
||||
}, bob);
|
||||
|
||||
assert.strictEqual(res.status, 200);
|
||||
assert.strictEqual(typeof res.body === 'object' && Array.isArray(res.body), true);
|
||||
assert.strictEqual(res.body.length, 2);
|
||||
});
|
||||
test('名前のみの検索で説明は検索できない', async () => {
|
||||
const res = await api('/channels/search', {
|
||||
query: 'bbb',
|
||||
type: 'nameOnly',
|
||||
}, bob);
|
||||
|
||||
assert.strictEqual(res.status, 200);
|
||||
assert.strictEqual(typeof res.body === 'object' && Array.isArray(res.body), true);
|
||||
assert.strictEqual(res.body.length, 0);
|
||||
});
|
||||
test('名前と説明の検索で名前を検索できる', async () => {
|
||||
const res = await api('/channels/search', {
|
||||
query: 'ccc1',
|
||||
}, bob);
|
||||
|
||||
assert.strictEqual(res.status, 200);
|
||||
assert.strictEqual(typeof res.body === 'object' && Array.isArray(res.body), true);
|
||||
assert.strictEqual(res.body.length, 1);
|
||||
assert.strictEqual(res.body[0].name, 'ccc1');
|
||||
});
|
||||
test('名前と説明での検索で説明を検索できる', async () => {
|
||||
const res = await api('/channels/search', {
|
||||
query: 'ddd1',
|
||||
}, bob);
|
||||
|
||||
assert.strictEqual(res.status, 200);
|
||||
assert.strictEqual(typeof res.body === 'object' && Array.isArray(res.body), true);
|
||||
assert.strictEqual(res.body.length, 1);
|
||||
assert.strictEqual(res.body[0].name, 'ccc1');
|
||||
});
|
||||
test('名前と説明の検索で名前を複数検索できる', async () => {
|
||||
const res = await api('/channels/search', {
|
||||
query: 'ccc',
|
||||
}, bob);
|
||||
|
||||
assert.strictEqual(res.status, 200);
|
||||
assert.strictEqual(typeof res.body === 'object' && Array.isArray(res.body), true);
|
||||
assert.strictEqual(res.body.length, 2);
|
||||
});
|
||||
test('名前と説明での検索で説明を複数検索できる', async () => {
|
||||
const res = await api('/channels/search', {
|
||||
query: 'ddd',
|
||||
}, bob);
|
||||
|
||||
assert.strictEqual(res.status, 200);
|
||||
assert.strictEqual(typeof res.body === 'object' && Array.isArray(res.body), true);
|
||||
assert.strictEqual(res.body.length, 2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('drive', () => {
|
||||
test('ドライブ情報を取得できる', async () => {
|
||||
await uploadFile(alice, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue