Skip to content

Commit e0ce2b9

Browse files
committed
no-mistakes(review): test(fr044-plan3): tighten text-only report test comments and assertions
1 parent 526ddc8 commit e0ce2b9

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎server/java/codegen-spring/src/test/java/com/metaobjects/generator/spring/SpringReportRestSurfaceTest.java‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,22 +233,17 @@ public void theAllowlistIsEveryDerivedFieldWithItsSubtypeBand() throws Exception
233233

234234
@Test
235235
public void theControllerServesTheListAndRefusesOnlyTheCollectionPost() throws Exception {
236+
// The generated-controller api-contract corpus proves the HTTP behavior (GET list,
237+
// POST 405, no /{id}); this pins the source-level shape that produces it.
236238
String src = Files.readString(generateAll("controller", withModel()).resolve("acme/shop/StoreTotalsController.java"));
237239
assertTrue("the segment is the report name, snake_cased and pluralized",
238240
src.contains("@RequestMapping(\"/api/store_totals\")"));
239241
assertEquals("one GET", 1, occurrences(src, "@GetMapping"));
240242
assertEquals("one POST", 1, occurrences(src, "@PostMapping"));
241243
assertFalse("no item route of any verb", src.contains("/{id}"));
242-
assertFalse(src.contains("@PathVariable"));
243-
assertFalse(src.contains("RequestMethod"));
244-
assertFalse(src.contains("findById"));
245-
assertTrue(src.contains("Map.of(\"error\", \"method_not_allowed\""));
246-
assertTrue("the 405 says what it refused",
247-
src.contains("verb + \" is not supported on a report (read-only).\""));
248244
assertFalse("nothing calls a report a projection", src.contains("projection"));
249245
assertTrue("every derived field is sortable",
250246
src.contains("SORT_ALLOWLIST = Set.of(\"purchases\", \"buyers\", \"revenue\");"));
251-
assertTrue(src.contains("StoreTotalsFilterAllowlist.FIELDS"));
252247
}
253248

254249
// === the refusal carried over from Plan 2 ================================

‎server/python/tests/codegen/test_report_router.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ def test_report_router_has_the_collection_routes_and_no_item_route() -> None:
163163

164164

165165
def test_report_allowlist_names_the_report_s_own_derived_fields() -> None:
166+
# Pins the generated allowlist field set; the booted api-contract report corpus drives
167+
# filters through it but does not itself assert which fields are in the allowlist.
166168
root = _load()
167169
model = report_read_model(_obj(root, "InvoiceStatusTotals"), root)
168170
src = render_filter_allowlist(model)

‎server/typescript/packages/codegen-ts/test/projection/queries-file.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ describe("renderQueriesFile — a served report and a keyless projection (FR-044
217217
});
218218

219219
test("a projection with an `id` column and no declared identity keeps its by-id query", async () => {
220-
// The id-by-convention shape: `getPkInfo` falls back to `id`, the column exists, and
221-
// the query compiles and works. It is not keyless, and its output does not move.
220+
// The id-by-convention shape: `getPkInfo` falls back to `id`, the column exists.
221+
// It is not keyless, so the generated by-id query text does not move.
222222
const { projection, ctx } = await loadProjectionFixture();
223223
expect(projection.primaryIdentity()).toBeUndefined();
224224
const out = renderQueriesFile(projection, ctx);

‎server/typescript/packages/codegen-ts/test/projection/routes-file.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ async function loadKeyedProjectionFixture() {
395395

396396
describe("renderRoutesFile — a served report (FR-044 Plan 3)", () => {
397397
test("a served report mounts a keyless read-only surface", async () => {
398+
// Pins the generated call shape (mount function, options, comment text) that the
399+
// booted-server api-contract report corpus exercises at runtime but does not itself pin.
398400
const root = await loadReportingModel();
399401
const model = reportReadModel(declared(root, "StoreTotals"), root);
400402
for (const out of [

0 commit comments

Comments
 (0)