Skip to content

Commit

Permalink
e2e api
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Sep 19, 2023
1 parent 9630eae commit 53b5ec6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/meteor/app/api/server/default/info.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { API } from '../api';
import { getLoggedInUser } from '../helpers/getLoggedInUser';
import { getServerInfo } from '../lib/getServerInfo';

API.default.addRoute(
'info',
{ authRequired: false },
{
async get() {
return API.v1.success(await getServerInfo(this.userId));
const user = await getLoggedInUser(this.request);
return API.v1.success(await getServerInfo(user?._id));
},
},
);
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/tests/end-to-end/api/00-miscellaneous.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('miscellaneous', function () {
.expect('Content-Type', 'application/json')
.expect(200)
.expect((res) => {
expect(res.body).to.have.property('version').and.to.be.a('string');
expect(res.body.info).to.have.property('version').and.to.be.a('string');
expect(res.body.info).to.have.property('build').and.to.be.an('object');
expect(res.body.info).to.have.property('commit').and.to.be.an('object');
Expand Down

0 comments on commit 53b5ec6

Please sign in to comment.