Updating test case.

This commit is contained in:
mike12345567 2023-03-06 15:31:27 +00:00
parent c51b9fb4b3
commit 13ae950101
1 changed files with 3 additions and 18 deletions

View File

@ -1,20 +1,7 @@
const { roles, utils } = require("@budibase/backend-core") const setup = require("../../tests/utilities")
const { checkBuilderEndpoint } = require("./utilities/TestFunctions")
const setup = require("./utilities")
const { BUILTIN_ROLE_IDS } = roles
jest.setTimeout(30000) jest.setTimeout(30000)
// jest.mock("../../../utilities/workerRequests", () => ({
// getGlobalUsers: jest.fn(() => {
// return {}
// }),
// getGlobalSelf: jest.fn(() => {
// return {}
// }),
// deleteGlobalUser: jest.fn(),
// }))
describe("/metrics", () => { describe("/metrics", () => {
let request = setup.getRequest() let request = setup.getRequest()
let config = setup.getConfig() let config = setup.getConfig()
@ -36,13 +23,11 @@ describe("/metrics", () => {
expect(res.text).toContain("budibase_tenant_user_count") expect(res.text).toContain("budibase_tenant_user_count")
}) })
it("should apply authorization to endpoint", async () => { it("endpoint should not be publicly exposed", async () => {
// await config.createUser() await request
const res = await request
.get(`/api/public/v1/metrics`) .get(`/api/public/v1/metrics`)
.set(config.publicHeaders()) .set(config.publicHeaders())
.expect(403) .expect(403)
}) })
}) })