Files
supabase/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineDestinationSelection.test.tsx
Victor FarazdagiandJoshen Lim 00adb5a81b chore(studio): remove the Iceberg pipeline destination (#52229)
## Problem

Retire the deprecated Iceberg (Analytics Bucket) destination from
Pipelines.

## Solution

- Remove the destination UI, configuration mappings, feature-flag usage,
and generated API variants.
- Remove the legacy Pipelines integration from Storage while preserving
standalone Analytics Buckets.
- Remove unused components and sheet-layout support, and add regression
coverage for retained Storage operations.
- Remove the stale Pipelines claim from the Storage docs overview.

## Validation

- Pipelines, Storage, and replication data tests
- After the final cleanup: Studio typecheck and all 3 Analytics Bucket
regression tests passed.
- Formatting, scoped ESLint, Knip, and whitespace checks passed; lint
warnings are pre-existing.
- Storage overview: Prettier, ESLint with zero warnings, content-listing
schema validation, and Markdown rendering passed.

Production API-type verification remains pending the coordinated API
deployment. Legacy Iceberg pipelines, destinations, and slots must be
cleaned up before rollout.

## Review instructions

1. Verify that Pipelines offers BigQuery, DuckLake, Snowflake, and
ClickHouse, with no Analytics Bucket option.
2. Verify that Storage Analytics Bucket creation, namespace/table
operations, and wrapper/key cleanup remain available without Pipelines
controls.

## Checklist

- [x] Read CONTRIBUTING.md.
- [x] Updated the Storage overview copy and checked the docs authoring
guidance.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-11-11 12:18:04 +03:00

70 lines
2.4 KiB
TypeScript

import { fireEvent, render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { describe, expect, it, vi } from 'vitest'
import { PipelineDestinationSelection } from './PipelineDestinationSelection'
const destinations = ['BigQuery', 'DuckLake', 'Snowflake', 'ClickHouse'] satisfies Parameters<
typeof PipelineDestinationSelection
>[0]['availableDestinations']
describe('PipelineDestinationSelection', () => {
it('shows only available destinations in the intended order', () => {
render(
<PipelineDestinationSelection
availableDestinations={['ClickHouse', 'BigQuery']}
value="BigQuery"
onChange={vi.fn()}
/>
)
expect(screen.getAllByRole('radio').map((radio) => radio.getAttribute('value'))).toEqual([
'BigQuery',
'ClickHouse',
])
expect(screen.getByRole('radio', { name: /BigQuery/ })).toBeChecked()
expect(screen.queryByText('Analytics Bucket')).not.toBeInTheDocument()
})
it('supports pointer and keyboard selection', async () => {
const onChange = vi.fn()
render(
<PipelineDestinationSelection
availableDestinations={destinations}
value="BigQuery"
onChange={onChange}
/>
)
await userEvent.click(screen.getByRole('radio', { name: /BigQuery/ }))
await userEvent.keyboard('{ArrowDown}')
await waitFor(() => expect(screen.getByRole('radio', { name: /DuckLake/ })).toHaveFocus())
await userEvent.keyboard(' ')
expect(onChange).toHaveBeenLastCalledWith('DuckLake')
fireEvent.click(screen.getByRole('radio', { name: /Snowflake/ }))
expect(onChange).toHaveBeenLastCalledWith('Snowflake')
})
it('blocks changes while disabled', () => {
const onChange = vi.fn()
render(
<PipelineDestinationSelection
availableDestinations={destinations}
value="BigQuery"
onChange={onChange}
disabled
/>
)
fireEvent.click(screen.getByRole('radio', { name: /DuckLake/ }))
expect(onChange).not.toHaveBeenCalled()
})
it('handles no available destinations without selecting one', () => {
const onChange = vi.fn()
render(
<PipelineDestinationSelection availableDestinations={[]} value={null} onChange={onChange} />
)
expect(screen.getByText('No destinations are available.')).toBeInTheDocument()
expect(screen.queryByRole('radiogroup')).not.toBeInTheDocument()
expect(onChange).not.toHaveBeenCalled()
})
})