Skip to content

Commit 17b6c48

Browse files
sadpandajoeclaude
andcommitted
test(alerts): pin type="number" absence on both InputNumber fields
The threshold assertions only fail on a revert because jest-dom reports a different value type; the screenshot width field had no equivalent guard, so a regression there would stay green. Add an explicit not.toHaveAttribute('type', 'number') on both inputs to pin the double-border fix directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 2b10149 commit 17b6c48

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

superset-frontend/src/features/alerts/AlertReportModal.test.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,9 @@ test('renders all Alert Condition fields', async () => {
615615
expect(sql).toBeInTheDocument();
616616
expect(condition).toBeInTheDocument();
617617
expect(threshold).toBeInTheDocument();
618+
// Guard against a double border: passing type="number" leaks onto the inner
619+
// input and matches the StyledInputContainer input[type='number'] border rule.
620+
expect(threshold).not.toHaveAttribute('type', 'number');
618621
});
619622
test('disables condition threshold if not null condition is selected', async () => {
620623
render(<AlertReportModal {...generateMockedProps(false, true, false)} />, {
@@ -852,7 +855,11 @@ test('shows screenshot width when PDF is selected', async () => {
852855
() => screen.getAllByText(/Send as PDF/i)[0],
853856
);
854857
expect(screen.getByText(/screenshot width/i)).toBeInTheDocument();
855-
expect(screen.getByRole('spinbutton')).toBeInTheDocument();
858+
const screenshotWidth = screen.getByRole('spinbutton');
859+
expect(screenshotWidth).toBeInTheDocument();
860+
// Guard against a double border: passing type="number" leaks onto the inner
861+
// input and matches the StyledInputContainer input[type='number'] border rule.
862+
expect(screenshotWidth).not.toHaveAttribute('type', 'number');
856863
});
857864

858865
// Schedule Section

0 commit comments

Comments
 (0)