style: run prettier formatter over src and tests

This commit is contained in:
2026-06-11 20:46:00 +05:30
parent 2389d4f297
commit 6b564a4569
211 changed files with 6134 additions and 4234 deletions
+3 -1
View File
@@ -13,7 +13,9 @@ describe('useScrollSync', () => {
it('throttles editor scroll events to 60fps', () => {
const onScroll = vi.fn();
const { result } = renderHook(() => useScrollSync({ onEditorScroll: onScroll }));
const mockEvt = { currentTarget: { scrollTop: 100, scrollHeight: 1000, clientHeight: 200 } } as any;
const mockEvt = {
currentTarget: { scrollTop: 100, scrollHeight: 1000, clientHeight: 200 },
} as any;
// All calls within the same act() - performance.now() stays at 0
// First call passes, subsequent calls within FRAME_MS are throttled
act(() => {
+12 -2
View File
@@ -95,7 +95,12 @@ describe('useShortcut', () => {
it('calls preventDefault when the shortcut matches', () => {
const cb = vi.fn();
renderHook(() => useShortcut('mod+s', cb));
const event = new KeyboardEvent('keydown', { key: 's', ctrlKey: true, bubbles: true, cancelable: true });
const event = new KeyboardEvent('keydown', {
key: 's',
ctrlKey: true,
bubbles: true,
cancelable: true,
});
window.dispatchEvent(event);
expect(event.defaultPrevented).toBe(true);
});
@@ -103,7 +108,12 @@ describe('useShortcut', () => {
it('does NOT call preventDefault when the shortcut does NOT match', () => {
const cb = vi.fn();
renderHook(() => useShortcut('mod+s', cb));
const event = new KeyboardEvent('keydown', { key: 'x', ctrlKey: true, bubbles: true, cancelable: true });
const event = new KeyboardEvent('keydown', {
key: 'x',
ctrlKey: true,
bubbles: true,
cancelable: true,
});
window.dispatchEvent(event);
expect(event.defaultPrevented).toBe(false);
});