test(etapi): port basic-auth

This commit is contained in:
Elian Doran
2025-06-02 21:43:40 +03:00
parent 26fcc4fb24
commit 4ed30e0624
2 changed files with 13 additions and 34 deletions

View File

@@ -38,4 +38,17 @@ describe("basic-auth", () => {
.auth("wrong", token, { "type": "basic"})
.expect(401);
});
it("logs out", async () => {
await supertest(app)
.post("/etapi/auth/logout")
.auth(USER, token, { "type": "basic"})
.expect(204);
// Ensure we can't access it anymore
await supertest(app)
.get("/etapi/notes/root")
.auth(USER, token, { "type": "basic"})
.expect(401);
});
});