mirror of
https://github.com/apache/superset.git
synced 2026-09-01 13:01:33 +00:00
chore(frontend): migrate SqlLab and explore JS/JSX files to TypeScript (#36760)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
aaa174f820
commit
9aff89c1b4
+12
-27
@@ -19,6 +19,7 @@
|
||||
import {
|
||||
render,
|
||||
screen,
|
||||
selectOption,
|
||||
userEvent,
|
||||
waitFor,
|
||||
} from 'spec/helpers/testing-library';
|
||||
@@ -210,39 +211,23 @@ test('fetches chart on mount if value present', async () => {
|
||||
});
|
||||
|
||||
test('keeps apply disabled when missing required fields', async () => {
|
||||
// With EVENT type and Table source, the component requires selecting a chart
|
||||
// and filling in required fields. Without completing these, Apply should be disabled.
|
||||
await waitForRender({
|
||||
annotationType: ANNOTATION_TYPES_METADATA.EVENT.value,
|
||||
sourceType: 'Table',
|
||||
});
|
||||
userEvent.click(
|
||||
screen.getByRole('combobox', { name: 'Annotation layer value' }),
|
||||
);
|
||||
expect(await screen.findByText('Chart A')).toBeInTheDocument();
|
||||
userEvent.click(screen.getByText('Chart A'));
|
||||
|
||||
// Apply button should be disabled initially since required fields are not filled
|
||||
expect(screen.getByRole('button', { name: 'Apply' })).toBeDisabled();
|
||||
|
||||
// Select Chart A from the annotation layer value dropdown
|
||||
await selectOption('Chart A', 'Annotation layer value');
|
||||
|
||||
// Wait for the chart data to load
|
||||
await screen.findByText(/title column/i);
|
||||
userEvent.click(
|
||||
screen.getByRole('combobox', { name: 'Annotation layer title column' }),
|
||||
);
|
||||
expect(await screen.findByText(/none/i)).toBeInTheDocument();
|
||||
userEvent.click(screen.getByText('None'));
|
||||
userEvent.click(screen.getByText('Style'));
|
||||
// The checkbox for automatic color is in the Style tab
|
||||
userEvent.click(screen.getByText('Use automatic color'));
|
||||
userEvent.click(
|
||||
screen.getByRole('combobox', { name: 'Annotation layer stroke' }),
|
||||
);
|
||||
expect(await screen.findByText('Dashed')).toBeInTheDocument();
|
||||
userEvent.click(screen.getByText('Dashed'));
|
||||
userEvent.click(screen.getByText('Opacity'));
|
||||
userEvent.click(
|
||||
screen.getByRole('combobox', { name: 'Annotation layer opacity' }),
|
||||
);
|
||||
expect(await screen.findByText(/0.5/i)).toBeInTheDocument();
|
||||
userEvent.click(screen.getByText('0.5'));
|
||||
|
||||
const checkboxes = screen.getAllByRole('checkbox');
|
||||
checkboxes.forEach(checkbox => userEvent.click(checkbox));
|
||||
|
||||
// Apply should still be disabled because name is not filled
|
||||
expect(screen.getByRole('button', { name: 'Apply' })).toBeDisabled();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user