fix(tests): use numeric id fixtures after zodBigintAsString was anchored - #1104
Merged
Conversation
#1069 changed `zodBigintAsString`'s pattern from `/\d+/` to `/^\d+$/`. The old pattern matched any string merely *containing* a digit, so fixtures like "ws-1" and "ci-1" passed validation despite never being shapes `createId()` can produce. Anchoring it is correct — it just left two test files behind, and `main` has been red since. - flow-import-handler: flow step ids "b1"/"s1" -> numeric - ads-conversion-rule.service: workspace, contact-inbox, integration and rule ids -> numeric, including the ids embedded in the expected event dedup keys Fixtures only; no production code changes.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainis currently red. #1069 tightenedzodBigintAsStringfrom/\d+/to/^\d+$/inpackages/utils/src/zod.ts. The old pattern was unanchored, so it matched any string merely containing a digit —"ws-1","ci-1","b1"all passed. Anchoring it is correct (createId()returns a numeric snowflake, so a real id is always all-digits), but two test files still carry the old-shaped fixtures and now fail validation.#1069 did fix the fixtures it noticed (
ads-campaign-wizard); these two were missed.This PR is fixtures only — no production code changes.
Changes
apps/worker/__tests__/flow-import-handler.test.ts— flow step ids"b1"/"s1"→ numeric. 9 tests were failing onflows.0.nodes.0.data.details.beforeStep.id.packages/business/__tests__/ads-conversion-rule.service.test.ts—workspaceId,contactInboxId,integrationId/integration*Idand rule ids → numeric. 55 tests were failing. The ids embedded in the expected event dedup keys (rule-<ruleId>-inbox-<contactInboxId>-<date>) are updated to match, so those assertions still check the real derived value.Ids that no schema validates (
event-*,clid-*,wamid.*, theImportRowid) are left as they are.Test plan
pnpm --filter worker test— 200 files, 1949 testspnpm --filter @chatbotx.io/business test— 153 files, 1695 testspnpm --filter builder test— 407 files, 2726 testspnpm lintpnpm --filter worker check-types,pnpm --filter @chatbotx.io/business check-types