oauthLoginAttemptGuard.test.ts 541 B

123456789101112131415
  1. import { describe, expect, it } from "vitest";
  2. import {
  3. shouldApplyOAuthPollingFailure,
  4. } from "../src/root/oauthLoginAttemptGuard.js";
  5. describe("OAuth login attempt guard", () => {
  6. it("ignores a polling failure after callback success", () => {
  7. expect(shouldApplyOAuthPollingFailure(true)).toBe(false);
  8. expect(shouldApplyOAuthPollingFailure(false)).toBe(true);
  9. });
  10. it("ignores a failure while the success callback is still completing", () => {
  11. expect(shouldApplyOAuthPollingFailure(false, true)).toBe(false);
  12. });
  13. });