diff --git a/frontend/src/views/CloudFolderView.vue b/frontend/src/views/CloudFolderView.vue index f8eb76d..bfc0868 100644 --- a/frontend/src/views/CloudFolderView.vue +++ b/frontend/src/views/CloudFolderView.vue @@ -127,9 +127,12 @@ async function load() { error.value = '' cloudStore.setBrowseState({ freshness: 'refreshing' }) try { + // "root" is a route-only sentinel. The browse API represents the + // connection root by omitting parent_ref (the empty string here). + const parentRef = folderId.value && folderId.value !== 'root' ? folderId.value : '' const data = await api.getCloudFoldersByConnectionId( connectionId.value, - folderId.value ?? 'root' + parentRef ) items.value = data.items ?? [] /** diff --git a/frontend/src/views/__tests__/CloudFolderView.test.js b/frontend/src/views/__tests__/CloudFolderView.test.js index 19eaa97..7943e2f 100644 --- a/frontend/src/views/__tests__/CloudFolderView.test.js +++ b/frontend/src/views/__tests__/CloudFolderView.test.js @@ -71,10 +71,11 @@ afterEach(() => { }) describe('CloudFolderView', () => { - it('calls getCloudFoldersByConnectionId with connection UUID, never provider slug', async () => { + it('browses the connection root without forwarding the route-only root sentinel', async () => { const w = mount(CloudFolderView, { global: { stubs: globalStubs } }) await flushPromises() - expect(api.getCloudFoldersByConnectionId).toHaveBeenCalledWith('uuid-conn-1', 'root') + expect(api.getCloudFoldersByConnectionId).toHaveBeenCalledWith('uuid-conn-1', '') + expect(api.getCloudFoldersByConnectionId).not.toHaveBeenCalledWith('uuid-conn-1', 'root') // Never called with provider slug expect(api.getCloudFoldersByConnectionId).not.toHaveBeenCalledWith('google_drive', expect.anything()) })