Skip to content

Commit

Permalink
Fix stepper validation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
2-towns committed Nov 27, 2024
1 parent 1b9bc61 commit 3072622
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions e2e/availabilities.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ test('create an availability', async ({ page }) => {
await page.locator('.availability-edit button').first().click();
await page.getByLabel('Total size').click();

const value = (Math.random() * 0.5);
const value = (Math.random() * 0.5) + 0.1;

await page.getByLabel('Total size').fill(value.toFixed(2));
await page.getByLabel('Total size').fill(value.toFixed(1));
await page.getByLabel('Duration').click();
await page.getByLabel('Duration').fill('30');
await page.getByLabel('Min price').click();
Expand Down
2 changes: 1 addition & 1 deletion src/components/Availability/availability.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const AvailabilityUtils = {
isValid: (
availability: AvailabilityState,
max: number
) => availability.totalSize > 0 && availability.totalSize <= max
) => availability.totalSize > 0 && availability.totalSize * AvailabilityUtils.unitValue(availability.totalSizeUnit) <= max
,
toggle: <T>(arr: Array<T>, value: T) =>
arr.includes(value) ? arr.filter(i => i !== value) : [...arr, value],
Expand Down

0 comments on commit 3072622

Please sign in to comment.