mirror of
https://github.com/logos-storage/logos-storage-marketplace-ui.git
synced 2026-01-08 00:13:06 +00:00
Fix stepper validation issue
This commit is contained in:
parent
1b9bc61647
commit
30726228bd
@ -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();
|
||||
|
||||
@ -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],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user