LOW-2 — webhook view timestamps must carry format: date-time.
(t *testing.T)
| 247 | |
| 248 | // LOW-2 — webhook view timestamps must carry format: date-time. |
| 249 | func TestSpecWebhookTimestampsFormatted(t *testing.T) { |
| 250 | doc := renderSpec(t) |
| 251 | check := func(schema string, fields ...string) { |
| 252 | props := schemaProps(t, doc, schema) |
| 253 | for _, f := range fields { |
| 254 | p, ok := props[f].(map[string]any) |
| 255 | if !ok { |
| 256 | continue // omitempty optional field may be absent only if removed; here all present |
| 257 | } |
| 258 | if p["format"] != "date-time" { |
| 259 | t.Errorf("%s.%s format = %v, want date-time", schema, f, p["format"]) |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | check("WebhookView", "created_at", "auto_disabled_at", "last_delivered_at") |
| 264 | check("WebhookDeliveryView", "created_at", "last_attempt_at", "next_retry_at") |
| 265 | } |
| 266 | |
| 267 | func keysOf(m map[string]any) []string { |
| 268 | out := make([]string, 0, len(m)) |
nothing calls this directly
no test coverage detected