OpenParable
Skip to content
← Back to skills

Dial Testing

Testing & Quality
dial-testing

Dial Testing is an Agent Skill for testing & quality published in the epam/ai-dial-chat repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Reference for testing ai-dial-chat - Vitest + @testing-library/react unit tests (Arrange/Act/Assert, vi.mock + vi.hoisted), Playwright e2e with dial fixtures and page objects, test locations, and run commands. Use when writing or fixing unit or e2e tests, setting up mocks, or running the test suites.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/epam/ai-dial-chat/blob/HEAD/.claude/skills/dial-testing/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/dial-testing, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

The full testing guide lives at .claude/guides/testing-patterns.md. Read it for the complete reference, then apply the patterns below.

When this applies

  • Writing or fixing unit tests (Vitest) or e2e tests (Playwright)
  • Setting up mocks, fixtures, or page objects
  • Running the test suites

Unit tests (Vitest)

  • Co-locate in apps/chat/src/[feature]/__tests__/*.test.ts(x).
  • Follow Arrange / Act / Assert with comments.
  • Name tests it('should ...').
  • Mock with vi.mock(); wrap mock factories in vi.hoisted() so they hoist before module evaluation.
import { describe, expect, it } from 'vitest';
import { render, screen } from '@testing-library/react';

describe('ErrorMessageDiv', () => {
  it('should render the error message', () => {
    // Arrange
    render(<ErrorMessageDiv error={error} />);
    // Act
    const title = screen.getByText(error.title);
    // Assert
    expect(title).toBeInTheDocument();
  });
});

E2E tests (Playwright)

  • Place in apps/chat-e2e/src/tests/[feature].test.ts.
  • Import the fixture: import { dialTest as test } from '@/src/core/dialFixtures'.
  • Use page objects from apps/chat-e2e/src/ui/ and builders from testData/.

Commands

ActionCommand
All unit testsnpm run test
Unit (chat only)npm run nx test chat
Watchnpm run nx test:watch chat
Coveragenpm run nx test:coverage chat
All e2enpm run nx e2e chat-e2e
Chat e2enpm run nx e2e:chat chat-e2e

See .claude/guides/testing-patterns.md for mocking tables, fixtures, setup, and troubleshooting.