Skip to content

test(carticon): add component pw tests for badge totalItems#100

Open
Tetiana-TC-QA wants to merge 2 commits intoidncod:masterfrom
Tetiana-TC-QA:test/carticon-badge-totalitems
Open

test(carticon): add component pw tests for badge totalItems#100
Tetiana-TC-QA wants to merge 2 commits intoidncod:masterfrom
Tetiana-TC-QA:test/carticon-badge-totalitems

Conversation

@Tetiana-TC-QA
Copy link
Copy Markdown
Contributor

@Tetiana-TC-QA Tetiana-TC-QA commented Apr 27, 2026

1.

Summary

Adds Playwright Component Tests for the CartIcon badge to ensure it always reflects the totalItems value from the cart context.

This PR implements QA‑029 and provides coverage for initial state, single‑item updates, and multi‑item updates using the real CartProvider and a dedicated CartIconHarness.

Scope

  • Area: icon
  • Type: test
  • Level: component
  • Priority: p1
  • Effort: small

Changes

  • Added CartIconHarness.tsx for controlled context updates in CT.
  • Added CartIconBadge.pw.spec.tsx with:
    • badge shows 0 when cart is empty
    • badge shows 1 after adding one item
    • badge shows 3 after adding multiple items
  • Ensured tests use the real CartProvider.

Issue

Closes #99

Tests pass locally.

2.

  • Added test-ct script to package.json for running Playwright Component Tests.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
snappycart Ready Ready Preview, Comment Apr 27, 2026 6:36pm

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

@Tetiana-TC-QA is attempting to deploy a commit to the idncod's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Tetiana-TC-QA
Copy link
Copy Markdown
Contributor Author

This PR is test-only. No changeset required.

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.

QA‑029. CartIcon: badge reflects total items from context

1 participant