mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-15 22:22:51 +00:00
23 lines
555 B
TypeScript
23 lines
555 B
TypeScript
import { Detecting } from '../../src/designer/detecting';
|
|
|
|
it('Detecting 测试', () => {
|
|
const detecting = new Detecting();
|
|
|
|
expect(detecting.enable).toBeTruthy();
|
|
|
|
const mockNode = { document };
|
|
detecting.capture(mockNode);
|
|
expect(detecting.current).toBe(mockNode);
|
|
|
|
detecting.release(mockNode);
|
|
expect(detecting.current).toBeNull();
|
|
|
|
detecting.capture(mockNode);
|
|
detecting.leave(document);
|
|
expect(detecting.current).toBeNull();
|
|
|
|
detecting.capture(mockNode);
|
|
detecting.enable = false;
|
|
expect(detecting.current).toBeNull();
|
|
});
|