Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/components/ProbeEditor/ProbeEditor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ describe('validation', () => {
const errorMessage = await screen.findByText('Longitude must be less than 180');
expect(errorMessage).toBeInTheDocument();
});

it('accepts coordinates with Google Maps precision', async () => {
const { user } = await renderProbeEditor();
const latitudeInput = await screen.findByLabelText('Latitude', { exact: false });
const longitudeInput = await screen.findByLabelText('Longitude', { exact: false });

await user.type(latitudeInput, '34.697135');
await user.type(longitudeInput, '-84.383184');

expect(latitudeInput).toHaveAttribute('step', '0.000001');
expect(longitudeInput).toHaveAttribute('step', '0.000001');
expect(latitudeInput).toBeValid();
expect(longitudeInput).toBeValid();
});
});

it('renders the back button', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProbeEditor/ProbeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const ProbeEditor = ({
})}
aria-label="Latitude"
placeholder="0.0"
step={0.00001}
step={0.000001}
type="number"
/>
</Field>
Expand All @@ -129,7 +129,7 @@ export const ProbeEditor = ({
valueAsNumber: true,
})}
aria-label="Longitude"
step={0.00001}
step={0.000001}
type="number"
placeholder="0.0"
/>
Expand Down
Loading