Skip to content

test: add dashboard and contracts page tests (#85)#162

Open
deborahamoni0-prog wants to merge 1 commit into
Tx-wat:mainfrom
deborahamoni0-prog:feat/issue-85-dashboard-contracts-tests
Open

test: add dashboard and contracts page tests (#85)#162
deborahamoni0-prog wants to merge 1 commit into
Tx-wat:mainfrom
deborahamoni0-prog:feat/issue-85-dashboard-contracts-tests

Conversation

@deborahamoni0-prog
Copy link
Copy Markdown

Summary

Closes #85

Adds lib/__tests__/dashboard.test.ts covering the logic layer that drives both the dashboard and contracts pages.

What's tested

  • Empty stategetContracts() and getTodayAlertCount() return zero values when nothing is stored
  • Populated state — contracts are saved, retrieved, updated (upsert), and deleted correctly
  • Filter behavior — active webhook count correctly excludes contracts with empty webhook_url
  • Stats rendering — contracts count, alerts-today count (excludes old alerts), and per-contract alert filter

Notes

The pages are 'use client' components that depend on localStorage and useEffect, so tests target the storage layer directly (same approach as existing lib/__tests__/ tests). All 12 tests pass.

Cover empty state, populated state, active webhook filter, and stats
rendering (contracts count, alerts today, per-contract alert filter)
via the storage layer that drives both pages.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@deborahamoni0-prog 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dashboard and contracts page tests

1 participant