MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestSpecWebhookTimestampsFormatted

Function TestSpecWebhookTimestampsFormatted

internal/httpapi/spec_review_test.go:249–265  ·  view source on GitHub ↗

LOW-2 — webhook view timestamps must carry format: date-time.

(t *testing.T)

Source from the content-addressed store, hash-verified

247
248// LOW-2 — webhook view timestamps must carry format: date-time.
249func 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
267func keysOf(m map[string]any) []string {
268 out := make([]string, 0, len(m))

Callers

nothing calls this directly

Calls 2

renderSpecFunction · 0.85
schemaPropsFunction · 0.85

Tested by

no test coverage detected