saleor-apps-redis_apl/apps/invoice-hub/src/modules/invoice-file-name/hash-invoice-filename.test.ts
Lukasz Ostrowski 1a6d39e2be add apps
2023-01-20 17:08:35 +01:00

16 lines
431 B
TypeScript

import { describe, it, expect, vi } from "vitest";
import { hashInvoiceFilename } from "./hash-invoice-filename";
vi.mock("crypto", () => ({
randomUUID() {
return "RANDOM_UUID_MOCK";
},
}));
describe("hashInvoiceFilename", () => {
it("Creates hashed invoice name", () => {
expect(hashInvoiceFilename("1/12/2022", "1234-xxxx-zzzz-1234")).toBe(
"1/12/2022_1234-xxxx-zzzz-1234_RANDOM_UUID_MOCK"
);
});
});