Farmbot-Web-App/frontend/__tests__/revert_to_english_test.ts

15 lines
499 B
TypeScript
Raw Normal View History

2018-01-23 14:27:24 -07:00
jest.mock("../i18n", () => {
return { detectLanguage: jest.fn(() => Promise.resolve({ lng: "de" })) };
});
import { detectLanguage } from "../i18n";
import { revertToEnglish } from "../revert_to_english";
2018-01-23 14:05:39 -07:00
describe("revertToEnglish", () => {
it("calls the appropriate handler with the appropriate config", () => {
2018-01-24 08:45:26 -07:00
jest.resetAllMocks();
2018-01-23 14:05:39 -07:00
revertToEnglish();
2018-01-23 14:27:24 -07:00
expect(detectLanguage).toHaveBeenCalledWith("en");
2018-01-24 08:45:26 -07:00
// expect(init).toHaveBeenCalled(); // WHY DOES THIS NOT WORK?
2018-01-23 14:05:39 -07:00
});
});