test(06-00): add failing describe blocks for OneDrive, SFTP, GCS, B2 in RemoteConfigStep (RED)

- BACK-01 (Phase 6): OneDrive — OAuth Token, Drive ID, Drive Type select
- BACK-02 (Phase 6): SFTP — Host, Username, Password tab, Private Key tab, tab-switching CSS-hide, value preservation
- BACK-03 (Phase 6): GCS — Project Number, Service Account JSON
- BACK-04 (Phase 6): Backblaze B2 — Application Key ID, Application Key
- 13 new tests fail RED; 8 existing tests remain green
This commit is contained in:
2026-03-30 18:08:57 +02:00
parent ad3d3240b1
commit 6f46f6b135
@@ -119,4 +119,112 @@ describe('RemoteConfigStep', () => {
}); });
}); });
}); });
describe('BACK-01 (Phase 6): OneDrive form', () => {
it('renders OAuth Token field', async () => {
renderWithBackend('onedrive' as BackendType);
await waitFor(() => {
expect(screen.getByLabelText(/oauth token/i)).toBeDefined();
});
});
it('renders Drive ID field', async () => {
renderWithBackend('onedrive' as BackendType);
await waitFor(() => {
expect(screen.getByLabelText(/drive id/i)).toBeDefined();
});
});
it('renders Drive Type select', async () => {
renderWithBackend('onedrive' as BackendType);
await waitFor(() => {
expect(screen.getByLabelText(/drive type/i)).toBeDefined();
});
});
});
describe('BACK-02 (Phase 6): SFTP form', () => {
it('renders Host field', async () => {
renderWithBackend('sftp' as BackendType);
await waitFor(() => {
expect(screen.getByLabelText(/host/i)).toBeDefined();
});
});
it('renders Username field', async () => {
renderWithBackend('sftp' as BackendType);
await waitFor(() => {
expect(screen.getByLabelText(/username/i)).toBeDefined();
});
});
it('shows Password tab button by default', async () => {
renderWithBackend('sftp' as BackendType);
await waitFor(() => {
expect(screen.getByText(/^password$/i, { selector: 'button' })).toBeDefined();
});
});
it('shows Private Key tab button', async () => {
renderWithBackend('sftp' as BackendType);
await waitFor(() => {
expect(screen.getByText(/private key/i, { selector: 'button' })).toBeDefined();
});
});
it('switching to Private Key tab CSS-hides password field and shows key_pem field', async () => {
renderWithBackend('sftp' as BackendType);
await waitFor(() => {
expect(screen.getByText(/private key/i, { selector: 'button' })).toBeDefined();
});
fireEvent.click(screen.getByText(/private key/i, { selector: 'button' }));
await waitFor(() => {
const passInput = screen.getByLabelText(/^password$/i);
const passWrapper = passInput.closest('div.hidden');
expect(passWrapper).toBeDefined();
const keyInput = screen.getByLabelText(/private key.*pem/i);
const keyWrapper = keyInput.closest('div.block');
expect(keyWrapper).toBeDefined();
});
});
it('switching SFTP auth tabs preserves hidden field value', async () => {
const user = userEvent.setup();
renderWithBackend('sftp' as BackendType);
await waitFor(() => {
expect(screen.getByLabelText(/^password$/i)).toBeDefined();
});
await user.type(screen.getByLabelText(/^password$/i), 'mysftppass');
fireEvent.click(screen.getByText(/private key/i, { selector: 'button' }));
fireEvent.click(screen.getByText(/^password$/i, { selector: 'button' }));
await waitFor(() => {
const input = screen.getByLabelText(/^password$/i) as HTMLInputElement;
expect(input.value).toBe('mysftppass');
});
});
});
describe('BACK-03 (Phase 6): Google Cloud Storage form', () => {
it('renders Project Number field', async () => {
renderWithBackend('gcs' as BackendType);
await waitFor(() => {
expect(screen.getByLabelText(/project number/i)).toBeDefined();
});
});
it('renders Service Account JSON field', async () => {
renderWithBackend('gcs' as BackendType);
await waitFor(() => {
expect(screen.getByLabelText(/service account json/i)).toBeDefined();
});
});
});
describe('BACK-04 (Phase 6): Backblaze B2 form', () => {
it('renders Application Key ID field', async () => {
renderWithBackend('b2' as BackendType);
await waitFor(() => {
expect(screen.getByLabelText(/application key id/i)).toBeDefined();
});
});
it('renders Application Key field', async () => {
renderWithBackend('b2' as BackendType);
await waitFor(() => {
// Matches "Application Key" but not "Application Key ID"
expect(screen.getByLabelText(/application key$/i)).toBeDefined();
});
});
});
}); });