From 39b893a5d864c3e1ff483ddd182e1514bb14cd4d Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 19 Sep 2023 14:05:55 -0300 Subject: [PATCH] e2e api --- apps/meteor/app/api/server/default/info.ts | 4 +++- apps/meteor/tests/end-to-end/api/00-miscellaneous.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/meteor/app/api/server/default/info.ts b/apps/meteor/app/api/server/default/info.ts index 0deda662275d..8297f90fffd9 100644 --- a/apps/meteor/app/api/server/default/info.ts +++ b/apps/meteor/app/api/server/default/info.ts @@ -1,4 +1,5 @@ import { API } from '../api'; +import { getLoggedInUser } from '../helpers/getLoggedInUser'; import { getServerInfo } from '../lib/getServerInfo'; API.default.addRoute( @@ -6,7 +7,8 @@ API.default.addRoute( { 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)); }, }, ); diff --git a/apps/meteor/tests/end-to-end/api/00-miscellaneous.js b/apps/meteor/tests/end-to-end/api/00-miscellaneous.js index 7525fd6ab443..e9fec42e4b66 100644 --- a/apps/meteor/tests/end-to-end/api/00-miscellaneous.js +++ b/apps/meteor/tests/end-to-end/api/00-miscellaneous.js @@ -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');