From d752503f24c183fc17584127177c33a3d37e15f5 Mon Sep 17 00:00:00 2001 From: Annie Black Date: Tue, 20 Feb 2024 10:42:45 -0500 Subject: [PATCH] DEVPROD-3295 update volume size default (#2252) --- src/components/Spawn/spawnHostModal/constants.ts | 2 +- src/components/Spawn/spawnHostModal/getFormSchema.tsx | 3 ++- src/components/Spawn/spawnVolumeModal/getFormSchema.tsx | 6 +++++- src/pages/spawn/spawnVolume/SpawnVolumeModal.test.tsx | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/Spawn/spawnHostModal/constants.ts b/src/components/Spawn/spawnHostModal/constants.ts index fe17725560..c2280164b0 100644 --- a/src/components/Spawn/spawnHostModal/constants.ts +++ b/src/components/Spawn/spawnHostModal/constants.ts @@ -1 +1 @@ -export const DEFAULT_VOLUME_SIZE = 500; +export const DEFAULT_VOLUME_SIZE = 256; diff --git a/src/components/Spawn/spawnHostModal/getFormSchema.tsx b/src/components/Spawn/spawnHostModal/getFormSchema.tsx index c751c579dc..2839ff8f35 100644 --- a/src/components/Spawn/spawnHostModal/getFormSchema.tsx +++ b/src/components/Spawn/spawnHostModal/getFormSchema.tsx @@ -10,6 +10,7 @@ import { } from "gql/generated/types"; import { shortenGithash } from "utils/string"; import { getDefaultExpiration } from "../utils"; +import { DEFAULT_VOLUME_SIZE } from "./constants"; import { validateTask } from "./utils"; import { DistroDropdown } from "./Widgets/DistroDropdown"; @@ -408,7 +409,7 @@ export const getFormSchema = ({ volumeSize: { title: "Volume size (GB)", type: "number" as "number", - default: 500, + default: DEFAULT_VOLUME_SIZE, }, }, }, diff --git a/src/components/Spawn/spawnVolumeModal/getFormSchema.tsx b/src/components/Spawn/spawnVolumeModal/getFormSchema.tsx index 4027dd5e96..4ee78f251c 100644 --- a/src/components/Spawn/spawnVolumeModal/getFormSchema.tsx +++ b/src/components/Spawn/spawnVolumeModal/getFormSchema.tsx @@ -1,5 +1,6 @@ import { css } from "@emotion/react"; import { add } from "date-fns"; +import { DEFAULT_VOLUME_SIZE } from "components/Spawn/spawnHostModal/constants"; import { GetFormSchema } from "components/SpruceForm/types"; import { ExpirationRow } from "../ExpirationRow"; import { getDefaultExpiration } from "../utils"; @@ -32,7 +33,10 @@ export const getFormSchema = ({ size: { title: "Size (GiB)", type: "number" as "number", - default: maxSpawnableLimit > 500 ? 500 : maxSpawnableLimit, + default: + maxSpawnableLimit > DEFAULT_VOLUME_SIZE + ? DEFAULT_VOLUME_SIZE + : maxSpawnableLimit, minimum: 1, maximum: maxSpawnableLimit, }, diff --git a/src/pages/spawn/spawnVolume/SpawnVolumeModal.test.tsx b/src/pages/spawn/spawnVolume/SpawnVolumeModal.test.tsx index daf037303f..6468632b5c 100644 --- a/src/pages/spawn/spawnVolume/SpawnVolumeModal.test.tsx +++ b/src/pages/spawn/spawnVolume/SpawnVolumeModal.test.tsx @@ -53,7 +53,7 @@ describe("spawnVolumeModal", () => { await waitFor(() => { expect(screen.queryByDataCy("spawn-volume-modal")).toBeVisible(); }); - expect(screen.queryByDataCy("volume-size-input")).toHaveValue("500"); + expect(screen.queryByDataCy("volume-size-input")).toHaveValue("256"); expect(screen.queryByDataCy("availability-zone-select")).toHaveTextContent( "us-east-1a", ); @@ -77,7 +77,7 @@ describe("spawnVolumeModal", () => { variables: { spawnVolumeInput: { availabilityZone: "us-east-1a", - size: 500, + size: 256, type: "gp2", expiration: null, noExpiration: true,