From 99e791b6e9559c0b21ea02bb83336425dac593ad Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Tue, 7 Jul 2026 23:40:29 +0800 Subject: [PATCH] test(caps): golden roundtrip case for content.published_block_configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cms host parity gate replays these goldens; the capability landed in v0.2.3 without them, so hosts on v0.2.3 fail TestGoldenParity — pin v0.2.4 instead. Co-Authored-By: Claude Fable 5 --- plugin/wasmguest/caps/caps_roundtrip_test.go | 13 +++++++++++++ .../golden/content_published_block_configs_req.pb | 2 ++ .../golden/content_published_block_configs_resp.pb | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 plugin/wasmguest/caps/testdata/golden/content_published_block_configs_req.pb create mode 100644 plugin/wasmguest/caps/testdata/golden/content_published_block_configs_resp.pb diff --git a/plugin/wasmguest/caps/caps_roundtrip_test.go b/plugin/wasmguest/caps/caps_roundtrip_test.go index f4c6f95..3f291b8 100644 --- a/plugin/wasmguest/caps/caps_roundtrip_test.go +++ b/plugin/wasmguest/caps/caps_roundtrip_test.go @@ -160,6 +160,19 @@ func TestCapabilityRoundTrip(t *testing.T) { } }, }, + { + name: "content_published_block_configs", wantMethod: "content.published_block_configs", + resp: &abiv1.ContentPublishedBlockConfigsResponse{Configs: [][]byte{[]byte(`{"captchaEnabled":true,"eventTypeSlug":"30min","username":"alice"}`)}}, + run: func(t *testing.T, cs plugin.CoreServices) { + got, err := cs.Content.PublishedBlockConfigs(ctx, "calcom:booking") + if err != nil { + t.Fatal(err) + } + if len(got) != 1 || got[0]["username"] != "alice" || got[0]["captchaEnabled"] != true { + t.Errorf("configs = %+v", got) + } + }, + }, { name: "content_get_page", wantMethod: "content.get_page", resp: &abiv1.ContentGetPageResponse{Page: &abiv1.PageInfo{Id: idAuthor.String(), Slug: "about", Title: "About Us"}}, diff --git a/plugin/wasmguest/caps/testdata/golden/content_published_block_configs_req.pb b/plugin/wasmguest/caps/testdata/golden/content_published_block_configs_req.pb new file mode 100644 index 0000000..917bc0d --- /dev/null +++ b/plugin/wasmguest/caps/testdata/golden/content_published_block_configs_req.pb @@ -0,0 +1,2 @@ + +calcom:booking \ No newline at end of file diff --git a/plugin/wasmguest/caps/testdata/golden/content_published_block_configs_resp.pb b/plugin/wasmguest/caps/testdata/golden/content_published_block_configs_resp.pb new file mode 100644 index 0000000..a75e57b --- /dev/null +++ b/plugin/wasmguest/caps/testdata/golden/content_published_block_configs_resp.pb @@ -0,0 +1,2 @@ + +B{"captchaEnabled":true,"eventTypeSlug":"30min","username":"alice"} \ No newline at end of file