Fix for issue 903: Crop tool now moves page focus to top after use

This commit is contained in:
Kelsey White committed 2026-10-16 13:09:32 -03:00
1 parent b5a69f9191
commit 6d8ef7d694
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',
});
});
});