From d68b9c2af10ed3cde24fe8e8bcc388cfb1d71c83 Mon Sep 17 00:00:00 2001 From: Sohan Maheshwar <1119120+sohanmaheshwar@users.noreply.github.com> Date: Wed, 17 Jun 2026 17:23:03 +0200 Subject: [PATCH 1/2] chore: bump examples submodule to pick up ai-agents schema Bumps the examples submodule to the merge commit of authzed/examples#47, which adds an "AI Agents acting on behalf of a user" example. Updates the LoadExamples test count to match the new total (9). --- examples | 2 +- src/spicedb-common/examples.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples b/examples index b17f5c8c..1a189ba3 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit b17f5c8c66b865441455ae07bcc04b60293e7dee +Subproject commit 1a189ba3101ffdc708eb7788fe87b56b4f7b3e3c diff --git a/src/spicedb-common/examples.test.ts b/src/spicedb-common/examples.test.ts index 2369227c..9beb74d9 100644 --- a/src/spicedb-common/examples.test.ts +++ b/src/spicedb-common/examples.test.ts @@ -6,7 +6,7 @@ describe("LoadExamples", () => { it("should correctly parse and return examples and skip those that are missing files", () => { const examples = LoadExamples(); - expect(examples).toHaveLength(8); + expect(examples).toHaveLength(9); examples.forEach(function (example) { expect(example.id).not.toBeNull(); From 2f6558c32f329f4754b7051e508024707cf20229 Mon Sep 17 00:00:00 2001 From: Sohan Maheshwar <1119120+sohanmaheshwar@users.noreply.github.com> Date: Wed, 17 Jun 2026 17:52:17 +0200 Subject: [PATCH 2/2] test: assert example loading by content, not by count Replaces the brittle `toHaveLength` check with explicit assertions that match what the test name promises: a known example is included, and the example with a missing schema file is skipped. Future examples can be added or removed without touching this test. --- src/spicedb-common/examples.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spicedb-common/examples.test.ts b/src/spicedb-common/examples.test.ts index 9beb74d9..50594aa9 100644 --- a/src/spicedb-common/examples.test.ts +++ b/src/spicedb-common/examples.test.ts @@ -6,7 +6,10 @@ describe("LoadExamples", () => { it("should correctly parse and return examples and skip those that are missing files", () => { const examples = LoadExamples(); - expect(examples).toHaveLength(9); + expect(examples.length).toBeGreaterThan(0); + const ids = examples.map((e) => e.id); + expect(ids).toContain("basic-rebac"); + expect(ids).not.toContain("multiple-validation-files"); examples.forEach(function (example) { expect(example.id).not.toBeNull();