[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
bem
/
assets
/
sweetalert
/
test
/
[
Home
]
File: actions.test.ts
import { swal, removeSwal, $$, CLASS_NAMES, } from './utils'; const { OVERLAY, CONFIRM_BUTTON, TITLE, } = CLASS_NAMES; afterEach(() => removeSwal()); describe("promise value", () => { test("dismisses modal by clicking on overlay", async () => { expect.assertions(1); setTimeout(() => { $$(OVERLAY).click(); }, 500); const value = await swal(); expect(value).toBeNull(); }); test("changes value with setActionValue", async () => { setTimeout(() => { swal.setActionValue("test"); $$(CONFIRM_BUTTON).click(); }, 500); const value = await swal(); expect(value).toEqual("test"); }); test("changes cancel value with setActionValue", async () => { setTimeout(() => { swal.setActionValue({ cancel: "test", }); $$(OVERLAY).click(); }, 500); const value = await swal(); expect(value).toEqual("test"); }); /* * @TODO! * test("cannot dismiss if 'clickOutside' is false", async () => { }); */ });