ObjToSchematic/tests/status.test.ts

37 lines
1.0 KiB
TypeScript
Raw Normal View History

2022-04-14 03:10:53 +08:00
import { StatusHandler } from '../src/status';
import { TEST_PREAMBLE } from './preamble';
2022-04-14 03:10:53 +08:00
test('Status', () => {
TEST_PREAMBLE();
2022-04-14 03:10:53 +08:00
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', () => {
TEST_PREAMBLE();
2022-04-14 03:10:53 +08:00
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);
2022-04-14 03:10:53 +08:00
StatusHandler.Get.clear();
expect(StatusHandler.Get.getStatusMessages('info').length).toBe(0);
expect(StatusHandler.Get.getStatusMessages('warning').length).toBe(0);
2022-04-14 03:10:53 +08:00
});