Agent skill

Uui Unit Testing

by epam in epam/UUI

Helps write unit tests for UUI components using Jest, jsdom, and @epam/uui-test-utils.

MITAuto-check passedTesting & QA

Install Uui Unit Testing

skills CLI
$ npx skills add epam/UUI --skill uui-unit-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install epam/UUI uui-unit-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/epam/UUI.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/unit-testing .claude/skills/uui-unit-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
uui-unit-testing
GitHub stars
248
Token cost
~2.4k tokens
SKILL.md length
494 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Helps write unit tests for UUI components using Jest, jsdom, and @epam/uui-test-utils.

  • Works in 4 steps: Run tests to see which snapshots fail → Review changes - verify the visual… → Update snapshots → …
  • Writing unit tests for UUI components
  • SKILL.md covers Test File Location, Test Commands, Using @epam/uui-test-utils and Test Structure, plus 6 more sections
  • Calls yarn

What it does

Uui Unit Testing is an agent skill from epam/UUI. Helps write unit tests for UUI components using Jest, jsdom, and @epam/uui-test-utils. Use when writing unit tests for UUI components, updating snapshots, running Jest tests, or working with test utilities.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing. It works with Jest, React and Testing Library. The repository describes itself as: React-based components and accelerators library built by EPAM Systems. The licence is MIT.

When your agent uses it

  • Writing unit tests for UUI components
  • Updating snapshots
  • Running Jest tests
  • Working with test utilities

Example prompts

  • “Use the uui-unit-testing skill to help write unit tests for UUI components using Jest, jsdom, and @epam/uui-test-utils”
  • “/uui-unit-testing”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Run tests to see which snapshots fail
  2. Review changes - verify the visual changes are intentional
  3. Update snapshots
  4. Commit updated snapshots along with component changes

What it can do on your machine

Read from SKILL.md and the folder at commit fd11393. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • yarn

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • uui.epam.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Uui Unit Testing loads about 2.4k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 494 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from epam/UUI at commit fd11393, republished under its MIT licence (© epam). 494 words, ~2,419 tokens.

Download SKILL.mdSave it as .claude/skills/uui-unit-testing/SKILL.md (or your agent's skills folder).
name
uui-unit-testing
description
Helps write unit tests for UUI components using Jest, jsdom, and @epam/uui-test-utils. Use when writing unit tests for UUI components, updating snapshots, running Jest tests, or working with test utilities.

UUI Unit Testing

UUI uses Jest with jsdom for unit testing React components. Tests are located in __tests__ folders within each package.

Test File Location

Test files follow the pattern: **/__tests__/**/*.test.{js,ts,tsx}

Examples:

  • uui/components/buttons/__tests__/Button.test.tsx
  • uui/components/inputs/__tests__/NumericInput.test.tsx
  • uui-core/src/hooks/__tests__/useVirtualList.test.tsx

Test Commands

Run all tests:

bash
yarn test

Run tests in watch mode:

bash
yarn test-watch

Run a single test file:

bash
yarn test -- --testPathPattern="Button"

Use --testPathPattern to match file path, or --testNamePattern="should render" to match test names.

Update snapshots:

bash
yarn test-update

Generate test coverage report:

bash
yarn test-report

Coverage report saves to .reports/unit-tests folder.

TypeScript type checking:

bash
yarn test-typecheck

Windows workaround: If encountering test errors on Windows, use reduced worker count:

bash
yarn test --maxWorkers=2 --testTimeout=10000

You can increase maxWorkers up to 4 if needed.

Using @epam/uui-test-utils

The @epam/uui-test-utils package provides helpers for testing UUI components with proper context.

Key Exports
ExportPurpose
renderSnapshotWithContextAsyncRender with UUI context, returns DocumentFragment for snapshots
renderWithContextAsyncRender with UUI context for interaction testing
renderHookWithContextAsyncTest custom hooks with UUI context
setupComponentForTestSetup component with mocks and setProps helper
screenRe-exported from @testing-library/react
userEventRe-exported from @testing-library/user-event
fireEventRe-exported from @testing-library/react
SvgMockMock for SVG icon imports in snapshots
mockReactPortalsForSnapshotsMock portals for snapshot tests
delay, delayActAsync timing utilities for tests
renderSnapshotWithContextAsync

Renders component with UUI context and returns a DocumentFragment (via asFragment()) for snapshot matching:

typescript
import { renderSnapshotWithContextAsync } from '@epam/uui-test-utils';
import { NumericInput } from '../NumericInput';

it('should be rendered with minimum props', async () => {
    const tree = await renderSnapshotWithContextAsync(
        <NumericInput value={null} onValueChange={jest.fn} min={0} max={50} />
    );
    expect(tree).toMatchSnapshot();
});
setupComponentForTest

Use for testing controlled components (e.g. value + onValueChange). Provides setProps to update props without unmounting, and mocks for callback assertions. Call context.current.setProperty(name, value) in callback mocks to simulate controlled updates:

typescript
import { setupComponentForTest, screen, fireEvent } from '@epam/uui-test-utils';
import { TextInput } from '@epam/uui';

interface TestComponentProps {
    value?: string;
    onValueChange?: (value: string) => void;
}

const { mocks, setProps } = await setupComponentForTest<TestComponentProps>(
    (context) => ({
        value: 'initial',
        onValueChange: jest.fn().mockImplementation((newValue) => {
            context.current.setProperty('value', newValue);
        }),
    }),
    (props) => <TextInput value={props.value} onValueChange={props.onValueChange} />,
);

const input = screen.queryByRole('textbox');
fireEvent.change(input, { target: { value: 'updated' } });
expect(mocks.onValueChange).toHaveBeenLastCalledWith('updated');

setProps({ value: 'external' }); // Update props without unmounting
renderHookWithContextAsync

Renders a hook with UUI context. Returns { result, rerender, unmount, svc }:

  • result — current hook return value (use result.current)
  • svc — UUI services (api, modals, router, etc.) for mocking or assertions
  • rerender, unmount — same as renderHook from Testing Library
typescript
import { renderHookWithContextAsync, act } from '@epam/uui-test-utils';

it('should use DataSource view', async () => {
    const dataSource = useArrayDataSource({ items: [...], getId: (i) => i.id }, []);
    const { result, svc } = await renderHookWithContextAsync(() =>
        dataSource.useView({}, () => {}, {})
    );
    const rows = result.current.getVisibleRows();
    expect(rows).toHaveLength(5);
    // svc.api, svc.uuiModals, etc. available for mocks
});

it('should test custom hook with services', async () => {
    const { result, svc } = await renderHookWithContextAsync(useMyHook);
    act(() => result.current.doSomething());
    expect(svc.uuiAnalytics.sendEvent).toHaveBeenCalled();
});
renderWithContextAsync

Renders component with UUI context for interaction testing:

typescript
import { renderWithContextAsync, screen, userEvent } from '@epam/uui-test-utils';
import { Tag } from '../Tag';

it('should call onClear callback', async () => {
    const onClearMock = jest.fn();
    
    await renderWithContextAsync(
        <Tag caption="Test badge" onClear={onClearMock} />
    );
    
    const clearButton = await screen.findByRole('button', { name: /remove tag/i });
    await userEvent.click(clearButton);
    
    expect(onClearMock).toHaveBeenCalled();
});

Test Structure

Basic Snapshot Test
typescript
import React from 'react';
import { ComponentName } from '../ComponentName';
import { renderSnapshotWithContextAsync } from '@epam/uui-test-utils';

describe('ComponentName', () => {
    describe('snapshots', () => {
        it('should be rendered with minimum props', async () => {
            const tree = await renderSnapshotWithContextAsync(<ComponentName />);
            expect(tree).toMatchSnapshot();
        });

        it('should be rendered with maximum props', async () => {
            const tree = await renderSnapshotWithContextAsync(
                <ComponentName prop1="value1" prop2="value2" />
            );
            expect(tree).toMatchSnapshot();
        });
    });
});
Interaction Test
typescript
import { renderWithContextAsync, screen, userEvent } from '@epam/uui-test-utils';

it('should handle user interaction', async () => {
    const onActionMock = jest.fn();
    
    await renderWithContextAsync(
        <ComponentName onAction={onActionMock} />
    );
    
    const button = await screen.findByRole('button');
    await userEvent.click(button);
    
    expect(onActionMock).toHaveBeenCalled();
});
Show full SKILL.md (218 more words)Show less

Snapshot Update Workflow

When UI changes require snapshot updates:

  1. Run tests to see which snapshots fail:

    bash
    yarn test
  2. Review changes - verify the visual changes are intentional

  3. Update snapshots:

    bash
    yarn test-update
  4. Commit updated snapshots along with component changes

Important: Always review snapshot diffs before updating. Snapshots should reflect intentional UI changes, not accidental regressions.

Test Environment

  • Test framework: Jest
  • Test environment: jsdom (for React components), node (for build scripts)
  • Test utilities: @epam/uui-test-utils for component testing helpers

Test Coverage

Test coverage is collected from:

  • uui-core
  • uui-components
  • uui
  • epam-promo
  • epam-electric
  • loveship

Run yarn test-report to generate coverage reports.

Common Patterns

Mocking Portals for Snapshots

Use the built-in helper instead of manual mocking:

typescript
import { mockReactPortalsForSnapshots, renderSnapshotWithContextAsync } from '@epam/uui-test-utils';

describe('ComponentWithPortal', () => {
    mockReactPortalsForSnapshots();

    it('should render correctly', async () => {
        const tree = await renderSnapshotWithContextAsync(<MyModal />);
        expect(tree).toMatchSnapshot();
    });
});
Testing with Icons

Use SvgMock from test utils for icon props in snapshots:

typescript
import { SvgMock, renderSnapshotWithContextAsync } from '@epam/uui-test-utils';

it('should render with icon', async () => {
    const tree = await renderSnapshotWithContextAsync(
        <Component icon={ SvgMock } />
    );
    expect(tree).toMatchSnapshot();
});

For specific icon imports (when behavior depends on the icon):

typescript
// @ts-expect-error
import { ReactComponent as CalendarIcon } from '@epam-assets/icons/action-calendar-fill.svg';

Best Practices

  1. Add tests for bug fixes - Prevent regressions
  2. Add tests for new functionality - Ensure components work as expected
  3. Update snapshots when UI changes - Keep snapshots current
  4. Run full test suite before committing - yarn test
  5. Use descriptive test names - Make failures easy to understand
  6. Test user interactions - Not just rendering, but behavior

References

  • Test utilities: @epam/uui-test-utils package
  • Example snapshot test: uui/components/inputs/__tests__/NumericInput.test.tsx
  • Example interaction test: uui/components/widgets/__tests__/Tag.test.tsx
  • Example setupComponentForTest: app/src/docs/_examples/testing/__tests__/testComponent.test.tsx
  • Example renderHookWithContextAsync: uui-core/src/data/forms/__tests__/useForm.test.tsx
  • Testing documentation: https://uui.epam.com/documents?id=testing-getting-started&mode=doc&isSkin=null&category=testing

© epam, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cursor/skills/unit-testing of epam/UUI.

Open the folder on GitHubat commit fd11393

Compare with similar skills

Uui Unit Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Uui Unit Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Uui Unit Testing this skillepam/UUI248—~2.4kAutomated safety check: PassMIT
Unit TestsKhan/wonder-blocks163—~4.2kAutomated safety check: PassMIT
React Testinggetsentry/sentry45k—~2.2kAutomated safety check: PassCustom licence
React Testingaffaan-m/ECC274k1 repos~3.3kAutomated safety check: PassMIT
Senior QAalirezarezvani/claude-skills28k1 repos~2.1kAutomated safety check: PassMIT
Senior QAborghei/Claude-Skills874—~1.6kAutomated safety check: PassMIT

Similar skills

  • Unit Tests

    Khan/wonder-blocks

    Jest + React Testing Library best practices for Wonder Blocks unit tests.

    163 GitHub stars~4.2k tokensUpdated today
    Testing & QAAuto-check passed
  • React Testing

    getsentry/sentry

    Official

    Write and review React/TypeScript tests for Sentry's frontend using Jest and React Testing Library.

    45k GitHub stars~2.2k tokensUpdated today
    Testing & QAAuto-check passed
  • React Testing

    affaan-m/ECC

    React component testing with React Testing Library, Vitest/Jest, MSW for network mocking, accessibility assertions with axe, and the decision boundary between component tests and Playwright/Cypress…

    274k GitHub starsUsed in 1 repo~3.3k tokens
    Testing & QAAuto-check passed
  • Senior QA

    alirezarezvani/claude-skills

    Generates unit tests, integration tests, and E2E tests for React/Next.js applications.

    28k GitHub starsUsed in 1 repo~2.1k tokens
    Testing & QAAuto-check passed
  • Senior QA

    borghei/Claude-Skills

    Testing for React/Next.js with Jest, React Testing Library, and Playwright.

    874 GitHub stars~1.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Testing Web

    ericrisco/rsc-harness

    A skill your agent uses when writing or fixing frontend unit, component or custom-hook tests with Vitest or Jest plus Testing Library — rendering a component in jsdom, testing a hook in isolation…

    156 GitHub stars~3.3k tokensUpdated today
    Testing & QAAuto-check passed

More from epam/UUI

All 10 skills in this repo
  • Helps create and modify UUI (EPAM Unified UI) components following established patterns.

    248 GitHub stars~2.8k tokensUpdated 8 days ago
    Auto-check passed
  • Helps work with UUI DataSources (ArrayDataSource, LazyDataSource, AsyncDataSource) powering PickerInput, DataTable, FiltersPanel, and other data-driven components.

    248 GitHub stars~1.5k tokensUpdated 8 days ago
    Auto-check passed
  • Helps update UUI documentation, add doc examples, configure Property Explorer, and manage component API documentation.

    248 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Helps create and maintain E2E and screenshot tests for UUI components using Playwright.

    248 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Fetches GitHub issues from URLs and creates implementation plans for UUI.

    248 GitHub stars~1.5k tokensUpdated 8 days ago
    Auto-check passed
  • Guides the UUI pull request process including branch naming, pre-PR checklist, changelog updates, and quality requirements.

    248 GitHub stars~1.7k tokensUpdated 8 days ago
    Auto-check: notes

Categories

Questions about Uui Unit Testing

What does Uui Unit Testing do?

Helps write unit tests for UUI components using Jest, jsdom, and @epam/uui-test-utils. Uui Unit Testing is an agent skill from epam/UUI. Helps write unit tests for UUI components using Jest, jsdom, and @epam/uui-test-utils.

When should I use Uui Unit Testing?

Uui Unit Testing fits situations like: writing unit tests for UUI components; updating snapshots; running Jest tests; working with test utilities.

How do I install Uui Unit Testing in Claude Code?

Run `npx skills add epam/UUI --skill uui-unit-testing -a claude-code`. Or copy the skill folder (.cursor/skills/unit-testing in epam/UUI) into .claude/skills/uui-unit-testing in your project. Claude Code loads it when a task matches its description.

How do I install Uui Unit Testing in Codex?

Run `npx skills add epam/UUI --skill uui-unit-testing -a codex`. Or copy the skill folder (.cursor/skills/unit-testing in epam/UUI) into .agents/skills/uui-unit-testing in your project. Codex loads it when a task matches its description.

Can I use Uui Unit Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add epam/UUI --skill uui-unit-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/uui-unit-testing, .gemini/skills/uui-unit-testing, .github/skills/uui-unit-testing and .opencode/skills/uui-unit-testing in your project.

What does Uui Unit Testing need to run?

Going by SKILL.md and its folder, Uui Unit Testing needs the command-line tools its instructions call (yarn).

Does Uui Unit Testing access the network?

SKILL.md names 1 domain. As links in the text: uui.epam.com. This is read from the text; nothing was executed.

Is Uui Unit Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Uui Unit Testing use?

Uui Unit Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Uui Unit Testing use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Uui Unit Testing?

Skills that share tags, products or a category with Uui Unit Testing: Unit Tests (Khan/wonder-blocks, 163 stars), React Testing (getsentry/sentry, 45k stars), React Testing (affaan-m/ECC, 274k stars) and Senior QA (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Uui Unit Testing?

epam (a GitHub organization) maintains it in epam/UUI, which has 248 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on September 29, 2026.

Source: epam/UUI on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.