Skip to content

test(dashmint-lab): add Playwright e2e suite#72

Merged
thephez merged 9 commits intomainfrom
test/dashmint-playwright
Apr 30, 2026
Merged

test(dashmint-lab): add Playwright e2e suite#72
thephez merged 9 commits intomainfrom
test/dashmint-playwright

Conversation

@thephez
Copy link
Copy Markdown
Collaborator

@thephez thephez commented Apr 30, 2026

Summary

  • Adds a Playwright e2e suite for dashmint-lab that runs against real Dash Platform testnet — no mocks, no fixtures faking SDK responses. Browse-only coverage runs without credentials; auth-gated coverage activates when PLATFORM_MNEMONIC is set.
  • Login fixture (loginViaModal, HAS_MNEMONIC) is ported from dashproof-lab and adapted to dashmint-lab's LoginModal strings, so auth-gated specs test.skip cleanly when no mnemonic is configured.
  • Includes one chain-mutating spec — the SetPrice round-trip (list → update → unlist → re-open verify) — which is reversible (no funds move). Transfer, purchase, and burn writes are deliberately excluded.

Bug fix included

Caught by the e2e SetPrice spec on a leftover-state run: SetPriceModal was treating $price === 0n as "listed" while every other surface (CardTile.hasPrice, dashmint-lite) treats zero as unlisted. Aligned SetPriceModal and added a Vitest regression test.

Summary by CodeRabbit

  • Bug Fixes

    • SetPrice modal now correctly treats zero price as unlisted instead of a current price.
  • Tests

    • Added comprehensive end-to-end test suite covering authentication flows, card browsing, marketplace operations, and pricing functionality.
  • Chores

    • Updated testing infrastructure, configuration, and documentation.

thephez and others added 9 commits April 30, 2026 10:57
Run against real testnet — no mocks. Covers browse-only queries, sub-tab
visibility, How-it-works tab, sort cycling, rarity rendering, and the
mint-tab login overlay. Write-tier flows are stubbed as skipped placeholders
pending a login fixture.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds LoginModal entry-point coverage (sidebar + Mint overlay, Esc/backdrop
close, advanced settings toggle), HowItWorks section + operations-table
assertions, name-sort alphabetical verification, CardTile owner explorer
link and overflow menu, browse-only Buy → LoginModal prompt, bogus
contract-id resilience, and a mobile-drawer toggle smoke test. Ignores
playwright-report/ and test-results/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collapses 12 spec files into 5 (auth, browse, card, how-it-works, login-modal)
and adds the dashproof-lab login-fixture pattern so auth-gated specs can
reach features the read-only tier can't (TransferModal recipient validation).
Also adds rarity/owner/price sort verifications, View-on-Explorer popup,
Copy-ID clipboard read, and DPNS @username rendering.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A card with $price === 0n is considered unlisted everywhere else
(CardTile.hasPrice, dashmint-lite). Aligning SetPriceModal so the
modal shows "Set price" instead of "Change price" for zero-priced
leftovers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sion

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

📝 Walkthrough

Walkthrough

This change introduces comprehensive end-to-end testing infrastructure for dashmint-lab using Playwright, including configuration, custom fixtures with login helpers, and multiple test suites covering authenticated flows, browsing, card interactions, and modals. Supporting updates include documentation, npm scripts, a component logic adjustment for price handling, and Vitest configuration changes.

Changes

Cohort / File(s) Summary
Test Infrastructure & Configuration
playwright.config.ts, vite.config.ts, package.json, .gitignore
Establishes Playwright E2E setup with env-var loading, Vite dev server integration on port 5180, test script commands (test:e2e, test:e2e:ui), and dependencies (@playwright/test, dotenv). Vitest is configured to exclude test/e2e/** files.
Test Fixtures & Utilities
test/e2e/fixtures.ts
Introduces custom test fixture that boots the app against real Dash Platform testnet, waits for SDK connectivity ("Connected" signal), and provides loginViaModal() helper for mnemonic-based auth. Re-exports rawTest for tests bypassing preconditions. Exports HAS_MNEMONIC flag and type utilities.
E2E Test Suites
test/e2e/auth.spec.ts, test/e2e/browse.spec.ts, test/e2e/card.spec.ts, test/e2e/how-it-works.spec.ts, test/e2e/login-modal.spec.ts
Comprehensive test coverage: auth-gated flows (transfer, purchase, burn, logout, SetPrice round-trip), browse tabs and sorting, card owner/explorer links and copy-to-clipboard, "How it works" UI, and login modal state transitions. Auth-gated tests are skipped unless PLATFORM_MNEMONIC is available; serial execution and skip guards included.
Documentation
CLAUDE.md, README.md
Documents new Playwright E2E commands, test suite location, architecture notes (real testnet, no SDK mocks, auth gating semantics), and constraint that only SetPrice round-trip mutates chain state.
Component Logic & Unit Test Update
src/components/SetPriceModal.tsx, test/SetPriceModal.test.tsx
Changes hasCurrentPrice from explicit undefined/null check to truthiness check on card.$price, affecting title and button labels. Adds unit test verifying zero-price handling as an unlisted state.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 Our test burrows grow wide and deep,
E2E sutures keeping features asleep,
Playwright hops through each auth and view,
From SetPrice round-trips to fresh login brew,
Real testnet checks—no mocks, all true! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding a Playwright end-to-end test suite to dashmint-lab, which is the primary focus of this PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/dashmint-playwright

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@example-apps/dashmint-lab/vite.config.ts`:
- Around line 28-29: The Vitest config's include pattern only matches
"*.test.{ts,tsx}" so spec files are ignored; update the include array in
vite.config.ts (the include property used with Vitest) to include both
"**/*.test.{ts,tsx}" and "**/*.spec.{ts,tsx}" (e.g., add the spec glob alongside
the existing test glob) so tests named *.spec.ts or *.spec.tsx under test/ are
discovered.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 792a200e-1f35-4868-9cfa-e2a0b4409268

📥 Commits

Reviewing files that changed from the base of the PR and between c07cb08 and 544f249.

⛔ Files ignored due to path filters (1)
  • example-apps/dashmint-lab/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (14)
  • example-apps/dashmint-lab/.gitignore
  • example-apps/dashmint-lab/CLAUDE.md
  • example-apps/dashmint-lab/README.md
  • example-apps/dashmint-lab/package.json
  • example-apps/dashmint-lab/playwright.config.ts
  • example-apps/dashmint-lab/src/components/SetPriceModal.tsx
  • example-apps/dashmint-lab/test/SetPriceModal.test.tsx
  • example-apps/dashmint-lab/test/e2e/auth.spec.ts
  • example-apps/dashmint-lab/test/e2e/browse.spec.ts
  • example-apps/dashmint-lab/test/e2e/card.spec.ts
  • example-apps/dashmint-lab/test/e2e/fixtures.ts
  • example-apps/dashmint-lab/test/e2e/how-it-works.spec.ts
  • example-apps/dashmint-lab/test/e2e/login-modal.spec.ts
  • example-apps/dashmint-lab/vite.config.ts

Comment thread example-apps/dashmint-lab/vite.config.ts
@thephez thephez merged commit 8cdc182 into main Apr 30, 2026
3 checks passed
@thephez thephez deleted the test/dashmint-playwright branch April 30, 2026 17:19
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.

1 participant