Skip to content

test(frontend): cover loan timeline order and missing event data - #2182

Merged
K1NGD4VID merged 2 commits into
LabsCrypt:mainfrom
DanbabaJr:test/2130-loan-timeline-ordering
Oct 25, 2026
Merged

K1NGD4VID merged 2 commits into
LabsCrypt:mainfrom
DanbabaJr:test/2130-loan-timeline-ordering

Conversation

@DanbabaJr

Copy link
Copy Markdown
Contributor

Summary

Closes #2130

Added deterministic frontend tests for the "LoanTimeline" component to cover timeline ordering and edge cases that were previously missing from the test suite.

Changes

  • Added tests for events with equal timestamps to verify consistent ordering.
  • Covered scenarios involving missing timeline events.
  • Added reverse-ordering tests to ensure events are displayed correctly regardless of their input order.
  • Verified expected behavior across success, failure, and boundary cases.
  • Ensured deterministic test results to prevent flaky regressions.

Testing

  • Ran the relevant frontend test suite.
  • Verified the documented timeline behavior and edge cases.
  • Confirmed the tests are suitable for CI execution.

Result

Improves regression coverage for loan timeline ordering and helps prevent future frontend display inconsistencies.

Pin the presentational contract of LoanTimeline so the reviewed gap around
event ordering cannot regress: already-ascending input renders in order,
reverse-chronological input is left to the caller rather than silently
re-sorted, and equal timestamps keep a stable sequence without React
duplicate-key noise. Unknown event types, missing amounts and absent tx
hashes degrade without crashing, and the empty state is asserted.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@github-actions github-actions Bot added the security:malware-suspected Automated malware indicator found in a pull request label Oct 22, 2026
@github-actions

Copy link
Copy Markdown

Malware detection scan flagged this pull request

The scan found 1 indicator(s) in the PR diff. This PR is blocked until a maintainer reviews the flagged files.

  • frontend/src/app/components/ui/LoanTimeline.test.tsx — hidden-appended-config-payload (high)

This is an automated triage signal; maintainers must verify whether the finding is malicious or intentional.

@DanbabaJr

Copy link
Copy Markdown
Contributor Author

PR File Line flagged
#2183 useNotificationStream.test.tsx function createSseResponse(signal?: AbortSignal): MockSse {
#2183 useNotificationStream.test.tsx async function flushStreamSetup() {
#2183 useNotificationStream.test.tsx function mockSSEStreams() {
#2183 useNotificationStream.test.tsx function seededQueryClient() {
#2182 LoanTimeline.test.tsx function makeEvent(overrides: Partial = {}): LoanEvent {
#2182 LoanTimeline.test.tsx function items() {

Malware suspicion is false positive

The PR malware scan's hidden-appended-config-payload rule matches any added
line containing 'function' (case-insensitive 'Function'), so plain test helper
declarations were flagged. Declare the helpers as const arrow functions; no
behaviour change.
@K1NGD4VID
K1NGD4VID merged commit 953859f into LabsCrypt:main Oct 25, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security:malware-suspected Automated malware indicator found in a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[test] Cover frontend loan timeline ordering

3 participants