mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-08 16:57:14 +01:00
Fix for issue 903: Crop tool now moves page focus to top after use
This commit is contained in:
1 parent
b5a69f9191
commit
6d8ef7d694
2 files changed
+21
-1
No files matched your search
@@ -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',
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user