chore: Fix the test

This commit is contained in:
BluJ
2023-05-08 11:03:26 -06:00
parent 1d5357cfc7
commit bb59b96e64
2 changed files with 12 additions and 14 deletions

View File

@@ -44,7 +44,7 @@ describe("values", () => {
name: "Testing", name: "Testing",
description: null, description: null,
warning: null, warning: null,
default: null, default: false,
}) })
const validator = value.validator const validator = value.validator
validator.unsafeCast(false) validator.unsafeCast(false)
@@ -239,7 +239,7 @@ describe("values", () => {
name: "test", name: "test",
description: null, description: null,
warning: null, warning: null,
default: null, default: false,
}), }),
}), }),
) )
@@ -254,7 +254,6 @@ describe("values", () => {
required: { default: null }, required: { default: null },
description: null, description: null,
warning: null, warning: null,
default: null,
}, },
Variants.of({ Variants.of({
a: { a: {
@@ -264,7 +263,7 @@ describe("values", () => {
name: "b", name: "b",
description: null, description: null,
warning: null, warning: null,
default: null, default: false,
}), }),
}), }),
}, },
@@ -304,7 +303,7 @@ describe("values", () => {
name: "Testing", name: "Testing",
description: null, description: null,
warning: null, warning: null,
default: null, default: false,
})) }))
const validator = value.validator const validator = value.validator
validator.unsafeCast(false) validator.unsafeCast(false)
@@ -314,7 +313,7 @@ describe("values", () => {
name: "Testing", name: "Testing",
description: null, description: null,
warning: null, warning: null,
default: null, default: false,
}) })
}) })
test("text", async () => { test("text", async () => {
@@ -507,7 +506,6 @@ describe("values", () => {
required: { default: null }, required: { default: null },
description: null, description: null,
warning: null, warning: null,
default: null,
}, },
Variants.of({ Variants.of({
a: { a: {
@@ -517,7 +515,7 @@ describe("values", () => {
name: "b", name: "b",
description: null, description: null,
warning: null, warning: null,
default: null, default: false,
}), }),
}), }),
}, },
@@ -528,7 +526,7 @@ describe("values", () => {
name: "b", name: "b",
description: null, description: null,
warning: null, warning: null,
default: null, default: false,
}), }),
}), }),
}, },
@@ -582,7 +580,7 @@ describe("Builder List", () => {
name: "test", name: "test",
description: null, description: null,
warning: null, warning: null,
default: null, default: false,
}), }),
}), }),
}, },

View File

@@ -351,11 +351,11 @@ import { Variants } from "${startSdk}/lib/config/builder/variants"
)}, )},
warning: ${JSON.stringify(value?.spec?.tag?.warning || null)}, warning: ${JSON.stringify(value?.spec?.tag?.warning || null)},
required: ${JSON.stringify( required: ${JSON.stringify(
!(value?.spec?.tag?.nullable || false) // prettier-ignore
? { default: null } 'default' in value?.spec ? {default: value?.spec?.default} :
: false, !!value?.spec?.tag?.nullable || false ? {default: null} :
false,
)}, )},
default: ${JSON.stringify(value?.spec?.default || null)},
}, ${variants}) }, ${variants})
`, `,
) )