mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-12-01 06:17:38 -07:00
[Test] Better /drive test
This commit is contained in:
parent
d85d334499
commit
0da6e7a161
1 changed files with 10 additions and 2 deletions
12
test/api.js
12
test/api.js
|
@ -766,14 +766,22 @@ describe('API', () => {
|
||||||
describe('drive', () => {
|
describe('drive', () => {
|
||||||
it('ドライブ情報を取得できる', () => new Promise(async (done) => {
|
it('ドライブ情報を取得できる', () => new Promise(async (done) => {
|
||||||
const me = await insertSakurako();
|
const me = await insertSakurako();
|
||||||
const file = await insertDriveFile({
|
await insertDriveFile({
|
||||||
|
user_id: me._id,
|
||||||
|
datasize: 256
|
||||||
|
});
|
||||||
|
await insertDriveFile({
|
||||||
|
user_id: me._id,
|
||||||
|
datasize: 512
|
||||||
|
});
|
||||||
|
await insertDriveFile({
|
||||||
user_id: me._id,
|
user_id: me._id,
|
||||||
datasize: 1024
|
datasize: 1024
|
||||||
});
|
});
|
||||||
request('/drive', {}, me).then(res => {
|
request('/drive', {}, me).then(res => {
|
||||||
res.should.have.status(200);
|
res.should.have.status(200);
|
||||||
res.body.should.be.a('object');
|
res.body.should.be.a('object');
|
||||||
res.body.should.have.property('usage').eql(1024);
|
res.body.should.have.property('usage').eql(1792);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in a new issue