import { describe, expect, it } from "@jest/globals"

import { parseSASRequestOtpError } from "./requestOtpError"

describe("requestOtpError", () => {
  it("parses error with invalid error code", () => {
    const actual = parseSASRequestOtpError({
      status: "status",
      error: "error",
      errorCode: "a" as unknown as number,
      databaseUUID: "9ffefefe-df0e-4229-9792-5ed31bef1db4",
    } as any)
    expect(actual).toEqual({
      errorCode: "UNKNOWN",
    })
  })
})
