mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-07 17:02:29 +01:00
26 lines
735 B
JavaScript
26 lines
735 B
JavaScript
import exec from "./ctrl_boot_backoffice.js";
|
|
|
|
describe("ctrl::boot", () => {
|
|
it("runs", async() => {
|
|
const start = new Date();
|
|
await exec();
|
|
expect(new Date() - start).toBeLessThan(100);
|
|
});
|
|
|
|
it("reset the history", () => {
|
|
expect(window.history.state).toEqual({});
|
|
});
|
|
|
|
it("setup the dom", () => {
|
|
expect(
|
|
document.body.classList.contains("touch-no") ||
|
|
document.body.classList.contains("touch-yes")
|
|
).toBe(true);
|
|
});
|
|
|
|
it("setup the error screen", () => {
|
|
expect(typeof window.onerror).toBe("function");
|
|
window.onerror("__MESSAGE__");
|
|
expect(document.body.outerHTML).toContain("__MESSAGE__");
|
|
});
|
|
});
|