test: add coverage for property, security, and KYC components (#924, #925, #926, #927) - #970
Merged
Conversation
…hain#924, MettaChain#925, MettaChain#926, MettaChain#927) Add Jest specs for DocumentSection and ShareButton (property document rendering and share flows), TransactionSecuritySettings (security toggle persistence), and the KYC components (step gating, rejection/retry states, and audit log rendering). Also repair the cacheManager test suite so it runs under `npm test`: - add the missing `defineChain` export to the viem mock, which broke every suite that transitively imports viem via chains.ts - mock ethers' sha256/toUtf8Bytes in cacheManager.test.ts (ethers 6.16 returns Node Buffers that fail instanceof against the jsdom Uint8Array) - fix the broken crypto.randomUUID polyfill in jest.setup.js so it emits a valid UUID v4, and update a stale sync-queue id assertion 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@DanielCharis1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
nanaf6203-bit
approved these changes
Aug 29, 2026
🔒 Preview Environment DestroyedThe preview environment for this PR has been torn down. |
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
Adds Jest test coverage for the four Stellar Wave issues assigned to @DanielCharis1:
DocumentSectionandShareButton(property document list rendering, download links, PDF viewer modal, share dialog, clipboard/native share flows)TransactionSecuritySettings(all four security toggles persist via the store, threshold saving/clamping, trusted-device trust/revoke, TOTP enrollment, persisted-state rendering)KycVerificationCenterstep gating, liveness advance, rejection/retry, progress;KycStatusBadgestatus labels;ComplianceAuditLogempty + entry rendering)cacheManagertest suite repaired so it runs undernpm test(41 tests, covering queue enqueue/flush, LRU/TTL lifecycle, and version migrations)Why cacheManager needed a repair
src/lib/__tests__/cacheManager.test.tsalready existed (44 tests from #715) but could not run onmain:__mocks__/viem.jswas missing thedefineChainexport, breaking any suite that transitively importsviemviasrc/config/chains.ts(e.g. cacheManager, walletStore).sha256always throws in the jsdom test env:toUtf8Bytes/cryptodigest values are Node Buffers, which fail theinstanceof Uint8Arraycheck against jsdom's realm — soaddToSyncQueue(dedupe hashing) broke. The test file now mocksetherswith deterministic equivalents.crypto.randomUUIDpolyfill injest.setup.jsproduced a non-UUID string (15 hex chars), and one sync-queue assertion expected the legacyDate.now()-randomid format.Verification
npx jest src/components/property/__tests__ src/components/security/__tests__ src/components/kyc/__tests__ src/lib/__tests__/cacheManager.test.ts src/store/__tests__/kycStore.test.ts src/store/__tests__/transactionSecurityStore.test.ts # 114 passed, 114 totalAll 41 cacheManager tests, 18 TransactionSecuritySettings tests, and the new property/KYC specs pass via
npm test(Jest). Note:npm testonmainhas other pre-existing failures (e.g. walletStore circular import) unrelated to these issues.closes #924
closes #925
closes #926
closes #927