ObjToSchematic/tests/status.test.ts

32 lines
940 B
TypeScript
Raw Normal View History

2022-04-14 03:10:53 +08:00
import { StatusHandler } from '../src/status';
test('Status', () => {
StatusHandler.Get.add(
'warning',
'This is a warning',
);
expect(StatusHandler.Get.getStatusMessages('warning').length).toBe(1);
StatusHandler.Get.clear();
expect(StatusHandler.Get.getStatusMessages('warning').length).toBe(0);
});
test('Status', () => {
StatusHandler.Get.add(
'warning',
'This is a warning',
);
StatusHandler.Get.add(
'info',
'This is some info',
);
StatusHandler.Get.add(
'info',
'This is some more info',
);
expect(StatusHandler.Get.getStatusMessages( 'info').length).toBe(2);
expect(StatusHandler.Get.getStatusMessages( 'warning').length).toBe(1);
StatusHandler.Get.clear();
expect(StatusHandler.Get.getStatusMessages( 'info').length).toBe(0);
expect(StatusHandler.Get.getStatusMessages( 'warning').length).toBe(0);
});