diff --git a/frontend/src/components/cloud/CloudCredentialModal.vue b/frontend/src/components/cloud/CloudCredentialModal.vue index c230a89..c8672af 100644 --- a/frontend/src/components/cloud/CloudCredentialModal.vue +++ b/frontend/src/components/cloud/CloudCredentialModal.vue @@ -5,7 +5,7 @@ @click.self="handleOverlayClick" @keydown.escape.window="handleEscape" > -
+

diff --git a/frontend/src/components/cloud/__tests__/CloudCredentialModal.mobile.test.js b/frontend/src/components/cloud/__tests__/CloudCredentialModal.mobile.test.js new file mode 100644 index 0000000..4e88ff0 --- /dev/null +++ b/frontend/src/components/cloud/__tests__/CloudCredentialModal.mobile.test.js @@ -0,0 +1,52 @@ +import { describe, it, expect, vi, beforeEach } from 'vitest' +import { mount } from '@vue/test-utils' +import { createPinia, setActivePinia } from 'pinia' + +vi.mock('../../../api/client.js', () => ({ + getConnectionConfig: vi.fn().mockResolvedValue({ connection_username: '', server_url: '' }), + connectWebDav: vi.fn(), +})) + +import CloudCredentialModal from '../CloudCredentialModal.vue' + +const globalStubs = { + AppIcon: true, +} + +const testProvider = { key: 'webdav', label: 'WebDAV' } + +beforeEach(() => { + setActivePinia(createPinia()) + vi.clearAllMocks() +}) + +describe('RESP-04: CloudCredentialModal mobile-safe panel', () => { + it('panel has max-h-[90vh] class for mobile scroll safety', () => { + const wrapper = mount(CloudCredentialModal, { + props: { show: true, provider: testProvider, existing: null }, + global: { stubs: globalStubs }, + }) + const panel = wrapper.find('[data-test="cloud-credential-modal-panel"]') + expect(panel.exists()).toBe(true) + expect(panel.classes()).toContain('max-h-[90vh]') + }) + + it('panel has overflow-y-auto class for mobile scroll', () => { + const wrapper = mount(CloudCredentialModal, { + props: { show: true, provider: testProvider, existing: null }, + global: { stubs: globalStubs }, + }) + const panel = wrapper.find('[data-test="cloud-credential-modal-panel"]') + expect(panel.classes()).toContain('overflow-y-auto') + }) + + it('panel not rendered when show=false', () => { + const wrapper = mount(CloudCredentialModal, { + props: { show: false, provider: testProvider, existing: null }, + global: { stubs: globalStubs }, + }) + // When show=false the v-if hides the entire overlay + const panel = wrapper.find('[data-test="cloud-credential-modal-panel"]') + expect(panel.exists()).toBe(false) + }) +}) diff --git a/frontend/src/components/documents/DocumentPreviewModal.vue b/frontend/src/components/documents/DocumentPreviewModal.vue index 903d3df..0699569 100644 --- a/frontend/src/components/documents/DocumentPreviewModal.vue +++ b/frontend/src/components/documents/DocumentPreviewModal.vue @@ -2,6 +2,7 @@