Farmbot-Web-App/webpack/saved_gardens/__tests__/apply_garden_test.ts
2018-04-20 11:26:18 -05:00

16 lines
442 B
TypeScript

jest.mock("axios", () => {
return { default: { patch: jest.fn(() => Promise.resolve()) } };
});
import { applyGarden } from "../apply_garden";
import { API } from "../../api";
import axios from "axios";
describe("applyGarden", () => {
it("calls the API and lets auto-sync do the rest", () => {
API.setBaseUrl("example.io");
applyGarden(4);
expect(axios.patch).toHaveBeenCalledWith(API.current.applyGardenPath(4));
});
});