test(`null filter values`, async () => { const res = await request(app) .get( '/cubejs-api/v1/load?query={"measures":["Foo.bar"],"filters":[{"dimension":"Foo.id","operator":"equals","values":[null]}]}' ) .set('Authorization', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.t-IDcSemACt8x4iTMCda8Yhe3iZaWbvV5XKSTbuAn0M') .expect(200); console.log(res.body); expect(res.body && res.body.data).toStrictEqual([{ 'Foo.bar': 42 }]); });
describe('POST /api/v1/session/api_key', () => { it('should create api key', async () => { await authenticatedRequest .post('/api/v1/session/api_key') .expect('Content-Type', /json/) .expect(201) .then((res) => { expect(res.body).to.have.property('api_key'); expect(res.body).to.have.property('session_id'); }); }); });
describe('DELETE /api/v1/calendar/:calendar_selector', () => { it('should delete a calendar', async () => { await authenticatedRequest .delete('/api/v1/calendar/test-calendar') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('success', true); }); }); });
describe('GET /api/v1/system/info', () => { it('should return system infos', async () => { await authenticatedRequest .get('/api/v1/system/info') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('platform'); expect(res.body).to.have.property('nodejs_version'); }); }); });
describe('POST /api/v1/house/:user_selector/user/:user_selector/seen', () => { it('should mark the user has seen in this house', async () => { await authenticatedRequest .post('/api/v1/house/test-house/user/john/seen') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('current_house_id', 'a741dfa6-24de-4b46-afc7-370772f068d5'); }); }); });
describe('GET /api/v1/gateway/instance/key', () => { it('should get instance keys', async () => { await authenticatedRequest .get('/api/v1/gateway/instance/key') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('rsa_fingerprint'); expect(res.body).to.have.property('ecdsa_fingerprint'); }); }); });
describe('GET /api/v1/gateway/status', () => { it('should get gateway status', async () => { await authenticatedRequest .get('/api/v1/gateway/status') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('connected'); expect(res.body).to.have.property('configured'); }); }); });