feat: add logto auth and backend metrics integration
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
import {
|
||||
isAuthRequestMessage,
|
||||
isAuthResponseMessage
|
||||
} from "../src/shared/auth-messages";
|
||||
|
||||
describe("auth-messages", () => {
|
||||
test("accepts a get-state request", () => {
|
||||
expect(isAuthRequestMessage({ type: "auth:get-state" })).toBe(true);
|
||||
});
|
||||
|
||||
test("rejects unknown auth requests", () => {
|
||||
expect(isAuthRequestMessage({ type: "auth:wat" })).toBe(false);
|
||||
});
|
||||
|
||||
test("accepts a successful auth response envelope", () => {
|
||||
expect(
|
||||
isAuthResponseMessage({
|
||||
ok: true,
|
||||
type: "auth:state",
|
||||
value: { isAuthenticated: false }
|
||||
})
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user