[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
bem
/
assets
/
sweetalert
/
test
/
[
Home
]
File: icons.test.ts
import { swal, $$, CLASS_NAMES, removeSwal, } from './utils'; const { ICON, } = CLASS_NAMES; afterEach(() => removeSwal()); describe("show icons", () => { test("shows icon depending on third argument", () => { swal("Error", "An error occured!", "error"); expect($$(ICON).length).toBe(1); expect($$(ICON).hasClass(`${ICON}--error`)).toBeTruthy(); }); test("shows icon when using 'icon' object key", () => { swal({ icon: 'warning', }); expect($$(ICON).length).toBe(1); expect($$(ICON).hasClass(`${ICON}--warning`)).toBeTruthy(); }); test("hides icon when setting 'icon' key to 'false'", () => { swal({ icon: false, }); expect($$(ICON).length).toBe(0); }); });