sfnext-testing

sfnext-testing is a skill for Claude Code, Codex from SalesforceCommerceCloud/b2c-developer-tooling. It costs 63 tokens per session (1,393 once invoked), scanned A, original, Apache-2.0.

Testing guidance for Storefront Next, a web storefront built with React, using Vitest and Storybook. It covers unit tests, component interaction tests, snapshots, and accessibility checks.

In plain words
What is it for?
Use it to write Vitest unit tests, create Storybook stories, test component interactions, run coverage, compare snapshots, and validate accessibility.
Why use it?
It gives developers established patterns for checking that components render correctly and continue to work after changes. It also helps test user interactions and identify accessibility problems.

Skill for Claude CodeCodex

Part of the storefront-next plugin — 18 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/salesforcecommercecloud/b2c-developer-tooling/sfnext-testing
Any agent
npx skills add SalesforceCommerceCloud/b2c-developer-tooling --skill sfnext-testing
Clone the repo
git clone --depth 1 https://github.com/SalesforceCommerceCloud/b2c-developer-tooling

Made for: Claude Code, Codex.

Or install storefront-next, the plugin that ships this one along with the rest of its 18 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sfnext-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/salesforcecommercecloud/b2c-developer-tooling/sfnext-testing.svg)](https://agentmods.dev/skills/salesforcecommercecloud/b2c-developer-tooling/sfnext-testing)
Your own site
<a href="https://agentmods.dev/skills/salesforcecommercecloud/b2c-developer-tooling/sfnext-testing"><img src="https://agentmods.dev/badge/skills/salesforcecommercecloud/b2c-developer-tooling/sfnext-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,393 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00063 $0.01393
Opus 5 $0.00032 $0.00696
Sonnet 5 $0.00013 $0.00279
Haiku 4.5 $0.00006 $0.00139

Measured yesterday against content hash bb6a9519253f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sfnext-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/storefront-next/skills/sfnext-testing/SKILL.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Skill

This skill covers testing patterns in Storefront Next — Vitest for unit tests and Storybook for component stories, interaction tests, and accessibility validation.

Unit Tests (Vitest)

Test files live alongside source files with .test.ts or .test.tsx extension:

// src/components/product-card/product-card.test.tsx
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import { ProductCard } from './product-card';
import { mockProduct } from '@/test-utils/mocks';

describe('ProductCard', () => {
    it('renders product name', () => {
        render(<ProductCard product={mockProduct} />);
        expect(screen.getByText(mockProduct.productName)).toBeInTheDocument();
    });
});

Test Utilities

Shared utilities in src/test-utils/:

  • config.ts — Mock configuration objects and ConfigProvider wrappers
  • context-provider-utils.ts — Context provider helpers for testing
  • context-provider.tsx — Test context providers

Running Tests

pnpm test                # Run all tests with coverage
pnpm test:ui             # Open interactive Vitest UI
pnpm test:watch          # Watch mode (re-run on changes)

Coverage Requirements

Thresholds enforced in vitest.thresholds.ts:

Metric Minimum
Lines 73%
Statements 73%
Functions 72%
Branches 67%

Testing Libraries

  • @testing-library/react — Component rendering and queries
  • @testing-library/jest-dom — Custom DOM matchers (toBeInTheDocument, etc.)
  • @testing-library/user-event — User interaction simulation
  • @vitest/coverage-v8 — Code coverage
  • @vitest/ui — Interactive test UI

Storybook

Every reusable component should have a .stories.tsx file.

Story Structure

// src/components/product-card/product-card.stories.tsx
import type { Meta, StoryObj } from '@storybook/react-vite';
import { within, expect } from 'storybook/test';
import { waitForStorybookReady } from '@storybook/test-utils';
import { ProductCard } from './product-card';
import { ConfigProvider } from '@/config/context';
import { mockConfig } from '@/test-utils/config';
import { mockProduct } from '@/test-utils/mocks';

const meta: Meta<typeof ProductCard> = {
    title: 'Components/ProductCard',
    component: ProductCard,
    tags: ['autodocs', 'interaction'],
    decorators: [
        (Story) => (
            <ConfigProvider config={mockConfig}>
                <Story />
            </ConfigProvider>
        ),
    ],
};

export default meta;
type Story = StoryObj<typeof ProductCard>;

export const Default: Story = {
    args: {
        product: mockProduct,
    },
    play: async ({ canvasElement }) => {
        await waitForStorybookReady(canvasElement);
        const canvas = within(canvasElement);
        await expect(canvas.getByText(mockProduct.productName)).toBeInTheDocument();
    },
};

Read the full file on GitHub · 185 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 185 lines · 63 tokens per session scan A bb6a9519253f

Subscribe to this mod's changes

sfnext-testing is a skill published in the GitHub repository SalesforceCommerceCloud/b2c-developer-tooling (53 stars, last pushed yesterday), licensed Apache-2.0. It adds 63 tokens to every session and 1,393 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

frontend-testing

Generate Vitest + React Testing Library tests for frontend components, hooks, and utilities. Triggers on testing, spec files, coverage, Vitest, RTL, unit tests, integration tests, or write/review test requests.

PageAI-Pro/ralph-loop · 48 tokens

react-testing

Write and review React/TypeScript tests for Sentry's frontend using Jest and React Testing Library. Use when adding or editing tests in static/ (.spec.tsx), writing component/hook tests, mocking API responses with MockApiClient, testing routing or network requests, or when asked to "write a frontend test", "add a…

getsentry/sentry · 86 tokens

authoring-data-quality-checks

Adds and runs data quality checks (dbt-test style assertions) on a project's warehouse tables and saved-query views: not-null, uniqueness, accepted values, referential integrity, row-count bounds, freshness, and custom HogQL. Use when asked to test a model, validate a view, check for nulls or duplicates, add data…

PostHog/posthog · 161 tokens

appbuilder-testing

Generate and run tests for Adobe App Builder actions and UI components. Scaffolds Jest unit tests, integration tests against deployed actions, contract tests for Adobe API interactions, and React component tests using Testing Library. Provides mock helpers for State, Files, Events SDKs, @adobe/aio-lib- clients, ExC…

adobe/skills · 201 tokens

testing

Skill "testing" from udecode/plate-playground-template, covering testing goal, core rules, seam selection, fixtures and assertions and quick reference.

udecode/plate-playground-template · 5 tokens

react-testing-library

React Testing Library best practices for writing maintainable, user-centric tests. Use when writing, reviewing, or refactoring RTL tests. Triggers on test files, testing patterns, getBy/queryBy queries, userEvent, waitFor, and component testing.

pproenca/dot-skills · 55 tokens