All new UI kit addded and tested successfully - #643
Merged
Conversation
|
@tzar-deek 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! 🚀 |
Collaborator
|
This branch cannot be rebased due to conflicts |
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.
Test Fix Report: ContractEventFeed & ErrorBoundary
Overview
I investigated and resolved two testing issues for
src/components/ContractEventFeed.tsxandsrc/components/ErrorBoundary.tsx. Both components already had substantial test coverage, but I identified and fixed gaps that caused test failures and left key behaviors unverified.Issue 1: ContractEventFeed Tests
Investigation
I read the component source and existing test file. The component fetches events on mount, supports live polling via
setInterval, handles error and empty states, and exposes a Live/Paused toggle. The existing test file (ContractEventFeed.test.tsx) had 36 tests covering:contractId[]pollIntervalusingvi.useFakeTimers()contractIdtriggering a new fetchProblem Found
Three tests in the "JSON export" describe block were failing. The root cause was a regex mismatch: the Export JSON button has a dynamically generated
aria-label:When events is empty, this produces
"Export 0 events as JSON". The test regex/export json/idid not match because of the0 events astext between "Export" and "JSON".Fix Applied
I updated the regex in all three failing test assertions from
/export json/ito/export.*json/i. This pattern correctly matches the dynamic aria-label regardless of the event count.File changed:
src/components/ContractEventFeed.test.tsxscreen.getByRole("button", { name: /export.*json/i })— "is disabled when there are no events"screen.getByRole("button", { name: /export.*json/i })— "exports a blob containing the exact events JSON"screen.getByRole("button", { name: /export.*json/i })— "names the downloaded file after the contract ID"Result
All 36 ContractEventFeed tests pass.
Issue 2: ErrorBoundary Tests
Investigation
I read the component source and existing test file. The component is a class-based error boundary that catches render errors and shows a fallback UI with "Try again" and "Reload page" buttons. The existing test file (
ErrorBoundary.test.tsx) had 15 tests covering:console.errorbeing mocked to suppress expected React error boundary logsonErrorcallback,onRetrycallback,isolatestyling,supportUrllink, dev-mode component stackProblem Found
The acceptance criteria specified a test for "Children render normally when
shouldThrowis false." This was missing — every existing test rendered a component that always throws, so there was no verification that the boundary correctly passes through children that don't throw.Fix Applied
I added a
ThrowingComponenttest helper and a new test:File changed:
src/components/ErrorBoundary.test.tsxResult
All 16 ErrorBoundary tests pass (15 existing + 1 new).
Final Verification
I ran both test files together:
All 52 tests pass. The other test failures in the full suite (190 failures across 25 unrelated files) are pre-existing and not related to my changes.
Related Issues