Repository navigation
test+docs: cover missing views/InvalidRate rollback, UI primitives, and api-types drift check (#1539 #1540 #1541 #1542) - #1628
Merged
K1NGD4VID merged 4 commits intoOct 18, 2026
Conversation
Add the two sibling-view tests missing from LabsCrypt#793's coverage and prove a rejected create_stream rolls back fully. LabsCrypt#1541: assert get_stream returns None for a never-created id, get_fee_config returns None before initialize, and is_stream_completed returns false for a never-created id. LabsCrypt#1542: with a 1% fee configured, a create_stream whose net rate rounds to zero returns InvalidRate while leaving the sender, treasury, and contract token balances untouched, and the stream-id counter is not consumed — the next successful stream is still id 1.
These primitives are imported across most pages and modals but, unlike their sibling Skeleton, had no test files. - Button: variant/size class application, disabled when disabled or loading, and the aria-busy + visually-hidden Loading label while loading. - Card: glow and hover prop toggles, base styling, children, and custom className merging. - Stepper: aria-current=step on the active step only, and the correct completed/active/upcoming class and screen-reader suffix per index. Closes LabsCrypt#1539
The CI job that regenerates api-types.generated.ts and diffs it against the checked-in snapshot already existed, but nothing told contributors it was there and the api-types.ts header still claimed codegen was manual-only. - Correct the api-types.ts header to describe the committed spec, the codegen commands, and the CI enforcement. - Add an 'API Types Drift Check' section to CONTRIBUTING.md plus local run steps and a PR checklist. - Add the drift check to the PR template checklist. Closes LabsCrypt#1540
next build's TypeScript pass failed with TS2532 on the indexed querySelectorAll accesses because tsconfig sets noUncheckedIndexedAccess. Use helpers that assert element presence and compare class lists with asymmetric matchers instead of raw indexing.
3 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
Resolves four third-wave-audit issues across the Soroban contracts and the frontend. Each is independently testable and the changes are grouped into one commit per issue.
Closes #1542
Closes #1541
Closes #1540
Closes #1539
Changes
Test create_stream InvalidRate rejection fully reverts fee+transfer (#1542)
contracts/stream_contract/src/test.rsNew
test_create_stream_invalid_rate_rolls_back_transfer_fee_and_counter:create_streamwithamount = 100,duration = 1000so the net amount (99) yields a0/s rate and the call returnsErr(InvalidRate).create_streamreceivesstream_id == 1, and that successful call does charge the fee (proving the fee machinery is exercised).get_stream/get_fee_config/is_stream_completed on missing state (#1541)
contracts/stream_contract/src/test.rstest_get_stream_missing_id_returns_none— never-created ids (0,1,u64::MAX) returnNone.test_get_fee_config_before_initialize_returns_none—get_fee_configreturnsNonebeforeinitialize.test_is_stream_completed_missing_id_returns_false— never-created ids returnfalse.Wire the api-types codegen drift check into CI + document it (#1540)
frontend/src/lib/api-types.ts,CONTRIBUTING.md,.github/pull_request_template.mdThe CI drift step (
npm run codegen:openapi->npm run codegen:api-types->git diff --exit-code) was already present in.github/workflows/ci.yml, but it was undocumented and theapi-types.tsheader still claimed codegen was manual-only. This change:api-types.tsheader to describe the committed spec, the codegen commands, and the CI enforcement.CONTRIBUTING.md, local run steps, and a PR checklist.Verified locally that
openapi-typescriptagainst the committedbackend/swagger/flowfi.openapi.jsonreproduces the checked-inapi-types.generated.tsbyte-for-byte, so the CI diff is currently clean.Add unit tests for shared Button, Card, and Stepper primitives (#1539)
frontend/src/components/ui/{Button,Card,Stepper}.test.tsxNew test files colocated with each component (matching
Skeleton.test.tsx):disabledorloadingis true, and thearia-busy+ visually-hiddenLoadinglabel while loading.classNamemerge.aria-current="step"on the active step only, and the correct completed/active/upcoming class and screen-reader suffix per index.Verification
cargo test -p stream_contract --lib— 253 passed, 1 ignored;cargo fmt --all -- --checkandcargo clippy --all-targets -- -D warningsclean.vitest run— 687 passed (74 files);eslintclean on all new files.Notes
No production contract logic changed — this PR is test and documentation only.