|
1
|
import { describe, expect, it } from "vitest" |
|
2
|
import { formatProvider } from "../format-provider" |
|
3
|
|
|
4
|
describe("formatProvider", () => { |
|
5
|
it("formats the provider name and its type", () => { |
|
6
|
expect(formatProvider("pp_stripe-blik_dkk")).toBe("Stripe Blik (DKK)") |
|
7
|
expect(formatProvider("pp_system_default")).toBe("System (DEFAULT)") |
|
8
|
}) |
|
9
|
|
|
10
|
it("formats a provider without a type", () => { |
|
11
|
expect(formatProvider("manual_manual")).toBe("Manual") |
|
12
|
}) |
|
13
|
|
|
14
|
it("keeps identifiers that contain underscores intact", () => { |
|
15
|
expect(formatProvider("pp_medusa-payments_acct_1S8eRlDAQUIGJhSY")).toBe( |
|
16
|
"Medusa Payments (acct_1S8eRlDAQUIGJhSY)" |
|
17
|
) |
|
18
|
}) |
|
19
|
|
|
20
|
it("returns IDs that don't follow the provider format as they are", () => { |
|
21
|
expect(formatProvider("custom")).toBe("custom") |
|
22
|
}) |
|
23
|
}) |