Skip to content

fix(tests): wire orphaned keys.test into test suite and delete dead simulation_cache.test - #551

Merged
AbdulmalikAlayande merged 1 commit into
TegoLabs:mainfrom
MrG139:fix/357-359-orphaned-test-files
Jul 30, 2026
Merged

AbdulmalikAlayande merged 1 commit into
TegoLabs:mainfrom
MrG139:fix/357-359-orphaned-test-files

Conversation

@MrG139

@MrG139 MrG139 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Closes #357 — moves src/alerts/keys.test.ts into tests/alerts/keys.test.ts so vitest picks it up (vitest.config.ts only globs tests/**/*.test.ts).

Closes #359 — deletes src/alerts/simulation_cache.test.ts because it defines an inline SimulationCacheManager class with no corresponding production module; no production simulation-cache implementation exists anywhere in the codebase.

Why?

Both test files lived under src/alerts/ and were never executed by vitest, rendering them dead code. This PR either wires them back into the test suite (if their subject is real production code) or removes them (if they tested inline-only or nonexistent modules).

Does this touch secret-key handling or transaction submission?

  • Yes — see notes above
  • No

Checklist

  • Tests pass (npm test)
  • Type check passes (npx tsc --noEmit)
  • Lint passes (npm run lint)
  • Tests cover the new functionality (TDD preferred)
  • No unnecessary dependencies added
  • Commit messages follow conventional format
  • No console.log in core logic
  • ADR added if this is a significant design decision
  • E2E sandbox tested, if this touches RPC or daemon behavior

…imulation_cache.test

- Move src/alerts/keys.test.ts → tests/alerts/keys.test.ts with corrected
  import path so vitest picks it up (vitest.config.ts globs tests/**/*.test.ts).
  The test exercises real production code in src/alerts/keys.ts and all 3
  tests pass.
- Delete src/alerts/simulation_cache.test.ts. The SimulationCacheManager class
  it tests is defined inline in the test file itself — no corresponding
  production module exists (no src/alerts/simulation_cache.ts, no cache logic
  in src/rpc/client.ts or src/core/extension.ts). It was an orphaned TDD
  exercise with no production counterpart to verify.

Closes TegoLabs#357
Closes TegoLabs#359
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@MrG139 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

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cd9c8a9f-0376-4466-8cfe-e2e995448573

📥 Commits

Reviewing files that changed from the base of the PR and between 35d9237 and df0878b.

📒 Files selected for processing (2)
  • src/alerts/simulation_cache.test.ts
  • tests/alerts/keys.test.ts
💤 Files with no reviewable changes (1)
  • src/alerts/simulation_cache.test.ts
📜 Recent review details
🔇 Additional comments (1)
tests/alerts/keys.test.ts (1)

7-7: LGTM!

Also applies to: 17-17, 43-50, 77-80


📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Updated key-storage tests to validate the production implementation.
    • Removed obsolete simulation-cache tests and their test-only implementation.

Walkthrough

The orphaned simulation cache test file and its in-file cache implementation are removed. The key tests now import the production alerts module while preserving their existing assertions and failure-case coverage.

Changes

Orphaned test cleanup

Layer / File(s) Summary
Production test wiring and validation
tests/alerts/keys.test.ts, src/alerts/simulation_cache.test.ts
Key tests reference the production module and retain save-key and invalid-input assertions; the orphaned simulation cache implementation and tests are deleted.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • AbdulmalikAlayande/sorokeep issue 354 — Covers similar cleanup of orphaned tests under src/alerts, though for a different module.

Possibly related PRs

Suggested reviewers: abdulmalikalayande

Poem

I hopped through tests beneath the moon,
Moved key checks to their proper room.
An orphaned cache file left the scene,
While saved passwords stayed pristine.
Thump, thump—cleanup complete! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: wiring in the keys test and deleting the dead simulation-cache test.
Description check ✅ Passed The description matches the changeset and explains why the test was moved and the orphaned file was deleted.
Linked Issues check ✅ Passed The PR satisfies #357 by moving keys.test into tests/ and #359 by deleting the orphaned simulation_cache.test file.
Out of Scope Changes check ✅ Passed The changes stay within the stated test-relevance cleanup and do not introduce unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gitguardian

gitguardian Bot commented Jul 29, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Generic High Entropy Secret ded54f4 tests/commands/guard-cli-export-import.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@AbdulmalikAlayande
AbdulmalikAlayande merged commit 7032d6f into TegoLabs:main Jul 30, 2026
3 of 5 checks passed
AbdulmalikAlayande pushed a commit that referenced this pull request Aug 2, 2026
…imulation_cache.test (#551)

Relocates src/alerts/keys.test.ts (misplaced outside the vitest.config.ts include glob) to tests/alerts/keys.test.ts, and deletes the orphaned src/alerts/simulation_cache.test.ts (a self-contained duplicate reimplementation of a SimulationCacheManager, never wired to the real module). Verified locally: lint, typecheck, full suite (1042/1042), build, and audit all clean. Closes #357, #359.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants