23 lines
845 B
TypeScript
23 lines
845 B
TypeScript
import { describe, expect, it, vi } from "vitest";
|
|
import { BusinessPartnersResource } from "../src/resources/BusinessPartners";
|
|
import { OrdersResource } from "../src/resources/Documents";
|
|
|
|
describe("resources", () => {
|
|
it("formats string keys for SAP Service Layer entity URLs", async () => {
|
|
const client = {
|
|
get: vi.fn().mockResolvedValue({ CardCode: "C'001" })
|
|
};
|
|
const resource = new BusinessPartnersResource(client as never);
|
|
|
|
await resource.get("C'001");
|
|
|
|
expect(client.get).toHaveBeenCalledWith("BusinessPartners('C''001')", undefined, expect.anything());
|
|
});
|
|
|
|
it("blocks delete for marketing documents by default", async () => {
|
|
const resource = new OrdersResource({} as never);
|
|
|
|
await expect(() => resource.delete(1)).toThrow("Orders does not support delete through this connector");
|
|
});
|
|
});
|