mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-15 15:22:28 +03:00
improve framework wrapper tests and vue component
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user