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