Merge pull request #919 from kelseyjmw/fix-crop-scroll

Fix crop scroll
This commit is contained in:
Alam authored and GitHub committed 2026-10-31 16:38:58 +05:30
commit 24b060a134
2 files changed
+21 -1

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { resetState } from '../js/logic/crop-pdf-page.ts';
// Test resetState function for cropping
describe('resetState', () => {
beforeEach(() => {
vi.spyOn(window, 'scrollTo').mockImplementation(() => {});
});
it('scrolls the page to the top after resetting', () => {
resetState();
expect(window.scrollTo).toHaveBeenCalledWith({
top: 0,
behavior: 'smooth',
});
});
});