/ tests / cas / 2fchoice.test.ts
2fchoice.test.ts
 1  import { describe, expect, it } from "bun:test";
 2  import { load } from "cheerio";
 3  
 4  import { PendingAuth } from "src/cas";
 5  import html from "./2fchoice.html" with { type: "text" };
 6  
 7  const document = load(html as unknown as string);
 8  
 9  describe("cas::2fchoice", () => {
10    it("is not solved", () => {
11      const auth = new PendingAuth(document);
12      expect(auth.solved).toBe(false);
13    });
14  
15    it("has email option", () => {
16      const auth = new PendingAuth(document);
17      expect(auth.isEmailAvailable).toBe(true);
18    });
19  
20    it("has totp option", () => {
21      const auth = new PendingAuth(document);
22      expect(auth.isTotpAvailable).toBe(true);
23    });
24  });