improve framework wrapper tests and vue component

This commit is contained in:
Rene Haas
2022-11-07 08:17:54 +01:00
parent c07071ed91
commit 0163a8a607
5 changed files with 108 additions and 85 deletions
@@ -240,4 +240,18 @@ describe('OverlayScrollbarsComponent', () => {
expect(onUpdatedInitial).toHaveBeenCalledTimes(3);
expect(onUpdated).toHaveBeenCalledTimes(3);
});
test('destroy', () => {
const ref: RefObject<OverlayScrollbarsComponentRef> = { current: null };
const { unmount } = render(<OverlayScrollbarsComponent ref={ref} />);
const { instance } = ref.current!;
expect(OverlayScrollbars.valid(instance())).toBe(true);
unmount();
expect(instance()).toBeDefined();
expect(OverlayScrollbars.valid(instance())).toBe(false);
});
});