midnight-cq:dapp-testing

Test Midnight DApp frontend components using a contract simulator without a live blockchain.

37|9|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/devrelaicom/midnight-expert --skill midnight-cq-dapp-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: midnight-cq:dapp-testing
Source: https://github.com/devrelaicom/midnight-expert/tree/main/plugins/midnight-cq/skills/dapp-testing
Command: npx skills add https://github.com/devrelaicom/midnight-expert --skill midnight-cq-dapp-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests the UI of Midnight DApps by validating end-to-end user flows, contract interactions, and wallet integration without needing a live blockchain or browser wallet.

Core Features & Use Cases

  • Layered testing approach: unit tests for components, integration tests with a contract simulator wrapping the ContractProvider, and end-to-end tests with Playwright to exercise wallet flows and UI states.
  • Wallet mocking and simulator-backed circuits: replace live network calls with a deterministic simulator to verify correct UI rendering and error handling.
  • Reference-guided patterns: includes documentation and patterns for mocking ContractProvider, writing robust tests, and organizing test suites so UI behaves correctly under varied scenarios.

Quick Start

Run a simple integration test by creating a mock ContractProvider and asserting initial UI-state render.

Frequently Asked Questions about midnight-cq:dapp-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test DApp UI components without connecting to a live blockchain?

DApp testing without a live blockchain uses a contract simulator backing the ContractProvider to replace network calls. This deterministic approach validates UI rendering, wallet connect/disconnect flows, and error handling across unit, integration, and end-to-end test layers.

How do I mock a wallet for Playwright end-to-end tests in a DApp?

Mocking a wallet for Playwright E2E tests uses mock wallet support to replace live browser wallet interactions. Combined with a contract simulator wrapping ContractProvider, this provides deterministic results to verify transaction submission and UI state interactions.

What is the best way to structure integration tests for Compact circuits?

The best way to structure Compact circuit integration tests uses Vitest test scaffolding with a contract simulator. This setup validates frontend components calling circuits through ContractProvider, ensuring correct state display and end-to-end flow execution.

Does Vitest work with a contract simulator for testing DApp frontend interactions?

Yes, Vitest works with a contract simulator for DApp testing by wrapping ContractProvider. This integration test layer validates initial UI-state rendering and verifies component interactions with Compact circuits deterministically without a live network.

Why does my DApp transaction submission test fail when using a live wallet?

DApp transaction submission tests fail with a live wallet due to non-deterministic network states. Replacing the live wallet and network with a contract simulator and mock wallet support ensures deterministic results, verifying contract state display and error handling reliably.