diff --git a/frontend/src/__tests__/keyboard.test.js b/frontend/src/__tests__/keyboard.test.js new file mode 100644 index 0000000..9dbde81 --- /dev/null +++ b/frontend/src/__tests__/keyboard.test.js @@ -0,0 +1,24 @@ +import { describe, it } from 'vitest' + +describe('UX-05: "/" focuses the search bar', () => { + it.todo('dispatching keydown "/" calls focus() on SearchBar input via App.vue routeViewRef chain') + it.todo('"/" does NOT redirect when an INPUT element has focus (guard: document.activeElement.tagName)') +}) + +describe('UX-06: "Escape" clears active search (when no input focused)', () => { + it.todo('keydown Escape clears searchQuery via FileManagerView.clearSearch()') + it.todo('Escape does NOT clear search while inside a focused INPUT') + it.todo('Escape does NOT double-trigger when DocumentPreviewModal is open (modal owns its Escape handler)') +}) + +describe('UX-07: "U" triggers the upload picker', () => { + it.todo('keydown "u" calls DropZone.triggerInput() through the ref chain (App→FileManagerView→StorageBrowser→DropZone)') + it.todo('"U" does NOT fire when input is focused') + it.todo('"U" is a no-op on routes that do not expose triggerUpload (optional chain)') +}) + +describe('UX-08: "N" starts new folder input', () => { + it.todo('keydown "n" calls StorageBrowser.startNewFolder() via ref chain') + it.todo('"N" does NOT fire when input is focused') + it.todo('"N" is a no-op on CloudFolderView (does not expose startNewFolder)') +}) diff --git a/frontend/src/components/layout/__tests__/OsDragOverlay.test.js b/frontend/src/components/layout/__tests__/OsDragOverlay.test.js new file mode 100644 index 0000000..904f0fc --- /dev/null +++ b/frontend/src/components/layout/__tests__/OsDragOverlay.test.js @@ -0,0 +1,11 @@ +import { describe, it } from 'vitest' + +describe('UX-09: OsDragOverlay shows when OS files are dragged over the window', () => { + it.todo('overlay hidden by default (dragDepth=0)') + it.todo('dragenter with dataTransfer.types including "Files" shows overlay') + it.todo('dragenter without "Files" type is ignored (in-app element drag)') + it.todo('dragleave decrements depth; overlay hides when depth reaches 0') + it.todo('drop event emits files-dropped with the file list') + it.todo('drop resets dragDepth to 0 and hides overlay') + it.todo('overlay is teleported to body with z-[9998] (below toast z-[9999])') +}) diff --git a/frontend/src/components/storage/__tests__/StorageBrowser.dragmove.test.js b/frontend/src/components/storage/__tests__/StorageBrowser.dragmove.test.js new file mode 100644 index 0000000..d5cfd45 --- /dev/null +++ b/frontend/src/components/storage/__tests__/StorageBrowser.dragmove.test.js @@ -0,0 +1,13 @@ +import { describe, it } from 'vitest' + +describe('UX-11: Drag-to-move document onto folder row', () => { + it.todo('dragOverFolderId set on @dragover applies bg-amber-50 ring-2 ring-inset ring-amber-300 to that folder row') + it.todo('drop on folder emits file-move with { fileId, folderId }') + it.todo('dragend resets draggingFile to null after nextTick (click-after-drag guard)') + it.todo('click on file row is suppressed when draggingFile is non-null') +}) + +describe('UX-11 (toast wiring): doMove emits toast', () => { + it.todo('successful moveToFolder triggers useToastStore.show("Document moved", "success")') + it.todo('failed moveToFolder triggers useToastStore.show("Move failed: ...", "error")') +})