This commit is contained in:
kakkokari-gtyih
2024-07-02 18:44:57 +09:00
parent 646750cd98
commit 70fe3574a8
2 changed files with 12 additions and 7 deletions

View File

@@ -117,12 +117,20 @@ describe('Endpoints', () => {
assert.strictEqual(res.body.birthday, myBirthday);
});
test('名前を空白にできる', async () => {
test('名前を空白のみにした場合nullになる', async () => {
const res = await api('i/update', {
name: ' ',
}, alice);
assert.strictEqual(res.status, 200);
assert.strictEqual(res.body.name, ' ');
assert.strictEqual(res.body.name, null);
});
test('名前の前後に空白を入れてもトリムされる', async () => {
const res = await api('i/update', {
name: ' あ い う ',
}, alice);
assert.strictEqual(res.status, 200);
assert.strictEqual(res.body.name, 'あ い う');
});
test('誕生日の設定を削除できる', async () => {