Add true/false to auto-htmx converter (#59)

- This will allow backups to be restored, converting the value as part of the restoration
This commit is contained in:
2026-07-07 20:26:34 -04:00
parent edb376c06c
commit 8e0b2df870
3 changed files with 11 additions and 8 deletions
+7 -3
View File
@@ -14,9 +14,13 @@ let autoHtmxTypeConverterTests = testList "AutoHtmxTypeConverter" [
let after = JsonConvert.SerializeObject(AutoHtmax, opts)
Expect.equal after "\"Max\"" "Auto htmx type serialized incorrectly"
}
test "succeeds when deserializing" {
test "succeeds when deserializing a string" {
let after = JsonConvert.DeserializeObject<AutoHtmxType>("\"Yes\"", opts)
Expect.equal after AutoHtmx "Auto htmx type not serialized incorrectly"
Expect.equal after AutoHtmx "Auto htmx type deserialized incorrectly"
}
test "succeeds when deserializing a boolean value" {
let after = JsonConvert.DeserializeObject<AutoHtmxType>("false", opts)
Expect.equal after NoAutoHtmx "Auto htmx type deserialized incorrectly"
}
]
@@ -30,7 +34,7 @@ let categoryIdConverterTests = testList "CategoryIdConverter" [
}
test "succeeds when deserializing" {
let after = JsonConvert.DeserializeObject<CategoryId>("\"test-cat-id\"", opts)
Expect.equal after (CategoryId "test-cat-id") "Category ID not serialized incorrectly"
Expect.equal after (CategoryId "test-cat-id") "Category ID deserialized incorrectly"
}
]