Skip to content

test(integration): computed indexed properties (port legacy 18)#730

Merged
kriszyp merged 4 commits into
mainfrom
claude/api-tests-computed-indexed-properties
May 23, 2026
Merged

test(integration): computed indexed properties (port legacy 18)#730
kriszyp merged 4 commits into
mainfrom
claude/api-tests-computed-indexed-properties

Conversation

@kriszyp
Copy link
Copy Markdown
Member

@kriszyp kriszyp commented May 22, 2026

Summary

  • Ports apiTests/tests/18_computedIndexedProperties.mjs to the new self-contained framework
  • Installs a computed component inline with installAppComponent, defining a Product table that has @computed(from: "...") expression fields and a JS-callback field via setComputedAttribute
  • Exercises REST PUT, search_by_value (with and without get_attributes), REST GET by id (with and without select), and REST query-string filters on both indexed computed attributes
  • Cleans up: delete, drop_table, drop_component

Test plan

  • CI passes on node shards (linux + macOS)
  • Suite is skipped on Windows (depends on restart_service http_workers)
  • All 9 tests pass: PUT, search raw, search computed, REST id, REST id+select, filter by jsTotalPrice, filter by totalPrice, delete, drop_table, drop_component

🤖 Generated with Claude Code

— Claude

Self-contained suite that installs the `computed` component, exercises
@computed(from:"...") expressions and JS-callback computed attributes
via REST PUT, search_by_value, and REST query-string filter paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kriszyp kriszyp requested a review from Ethan-Arrowood May 22, 2026 13:01
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 22, 2026

Reviewed; no blockers found.

kriszyp and others added 2 commits May 22, 2026 07:11
Caught by Gemini review: jsTotalPrice was requested in get_attributes
but not asserted, leaving JS-callback computed fields unverified via
the Operations API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
search_by_value returns the stored indexed value, which is null when the
record is PUT before resources.js finishes loading (setComputedAttribute
is a runtime registration, not embedded in the schema). The legacy test
correctly omitted this assertion. jsTotalPrice is covered by the REST GET
with ?select test, which evaluates it on-demand.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kriszyp
Copy link
Copy Markdown
Member Author

kriszyp commented May 22, 2026

Unit Test (Node.js v24) failed on ws-test.mjs: default subscribe on WS — a 5s WebSocket timeout. This is a pre-existing flake: the same branch passed unit tests on the immediately preceding run (26289785536), and the same failure has appeared on unrelated branches (e.g. fix-undefined-primary-key-patch run 26271046913). No changes in this PR touch ws-test.mjs or any WebSocket code.

— Claude

@kriszyp kriszyp merged commit 28b02dc into main May 23, 2026
36 of 37 checks passed
@kriszyp kriszyp deleted the claude/api-tests-computed-indexed-properties branch May 23, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants