# Data app testing

> Data app testing is an open-source agent skill for developer tools. Writes unit and Playwright tests for a Metabase data app with mocked queries and actions. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/metabase/metabase-cli/tree/main/packages/cli/skill-data/data-app-testing
- **Repository:** https://github.com/metabase/metabase-cli
- **GitHub stars:** 20
- **License:** AGPL-3.0
- **Skill name:** data-app-testing
- **Collection:** https://github.com/metabase/metabase-cli
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill covers testing a Metabase data app at two levels. Each component that renders data or runs an action gets a Vitest and Testing Library unit test that runs without a Metabase instance, with the SDK's test provider supplying mocked answers to the questions and actions the component uses. Components that build runtime query clauses keep them in a shared companion file so the component and its test use identical values, and the skill explains how mocks match requests and what the error for an unmatched request means.

For end-to-end coverage, the skill guides writing one Playwright spec per page that runs against the developer preview and real instance data. The specs check that pages open, that queries return rows, that filters and links change the view, and that visualization settings actually appear on the drawn chart. Action specs open forms and only submit them when the database may be written to. Tests are run with npm scripts, and the skill notes what CI needs, including environment variables and a published SDK version.

The skill expects a Metabase data app project generated from the Metabase CLI template, with Node tooling, Vitest, Playwright and the Metabase embedding SDK installed. It is meant to be used alongside the data app creation and release skill and the skills for data and actions hooks.

## When your agent uses it

> Test a Metabase data app — a unit test next to each component with Vitest, Testing Library and the SDK's `MetabaseTestProvider`, its questions and actions mocked from the exports of `src/metabase.queries.ts` and `src/metabase.actions.ts`, and runtime clauses in a `<Component>.query.ts` file the component and its test share; a Playwright spec per page against the dev preview and real data. Triggers — "test the data app", "add tests", "mock a query", "the test fails with No mock for query", "add an e2e test", "run the Playwright tests". Creating and releasing the app is `data-app`; its hooks are `data-app-data` and `data-app-actions`.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/metabase/metabase-cli/tree/HEAD/packages/cli/skill-data/data-app-testing)
- [Asks for: Read, Write, Edit, Bash](https://github.com/metabase/metabase-cli/blob/HEAD/packages/cli/skill-data/data-app-testing/SKILL.md)
- [License: AGPL-3.0](https://github.com/metabase/metabase-cli/tree/HEAD/packages/cli/skill-data/data-app-testing)

## Features

- **Component unit tests:** Sets up Vitest and Testing Library tests next to each component, with a render helper wrapping the SDK test provider.
- **Mocked queries and errors:** Answers questions with partial mock rows or error responses, so components can be tested without a live instance.
- **Runtime clause files:** Keeps query clauses in a shared companion file so components and their tests match the same mocked requests.
- **Action mocking and assertions:** Mocks actions with the right response for insert, update or delete and checks the parameters each call received.
- **Playwright page specs:** Writes one end-to-end spec per page against the dev preview, checking rows, filters, links and chart settings.
- **Pre-handoff checks:** Lists the unit, typecheck and end-to-end commands to run before the app is released.

## Good for

- Add unit tests for a component that shows query results
- Mock a query so a component's error state can be tested
- Write a Playwright test that checks a filter updates the orders table
- Test that a button submits the right parameters to an update action
- Debug a test failing with a missing query mock

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/data-app-testing` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/metabase/metabase-cli.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/data-app-testing &&
cp -R "$tmp/packages/cli/skill-data/data-app-testing" ~/.claude/skills/data-app-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/data-app-testing` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/data-app-testing` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/metabase/metabase-cli.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/data-app-testing &&
cp -R "$tmp/packages/cli/skill-data/data-app-testing" ~/.agents/skills/data-app-testing &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/data-app-testing` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/data-app-testing` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/metabase/metabase-cli.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/data-app-testing &&
cp -R "$tmp/packages/cli/skill-data/data-app-testing" ~/.cursor/skills/data-app-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/data-app-testing` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/metabase/metabase-cli.git --path packages/cli/skill-data/data-app-testing
```

Or copy the folder to `~/.gemini/skills/data-app-testing` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/data-app-testing`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/metabase/metabase-cli.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/data-app-testing &&
cp -R "$tmp/packages/cli/skill-data/data-app-testing" ~/.copilot/skills/data-app-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/data-app-testing` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/metabase/metabase-cli.git
```

Then copy `metabase-cli/packages/cli/skill-data/data-app-testing` into your agent's skills folder as `data-app-testing`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run the tests?

Unit tests run with npm run test:unit without a Metabase instance. End-to-end tests run npm run test:e2e against the dev preview and need a .env.local file, plus npx playwright install chromium on the first run.

### Why does a test fail with No mock for query?

A request has no mock whose runtime clauses match it. Either the clauses differ from every mock or the query has no mock at all, so the test needs a mock for that exact set of clauses.

### Does the skill submit actions against real data?

Action specs open the form and check its fields. They submit only when the user has said the app's database may be written to, since a submitted action changes real data.

### Which environment variables does CI need?

The end-to-end specs in CI need DATA_APP_MB_URL and DATA_APP_MB_API_KEY set in the job environment, and the SDK must be installed from a published version in package.json.

### How do I install Data app testing in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/data-app-testing to use it in all your projects, or to .claude/skills/data-app-testing in one project.

### Does Data app testing run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Data app testing?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Data app testing?

The closest alternatives to Data app testing are Data app, Webapp testing, Data app UI, Data app actions and Application testing.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Data app](https://ai-powered.com/skills/data-app): Data app is an open-source agent skill for developer tools.
- [Webapp testing](https://ai-powered.com/skills/webapp-testing-github): Webapp testing is an open-source agent skill for browser automation.
- [Data app UI](https://ai-powered.com/skills/data-app-ui): Data app UI is an open-source agent skill for developer tools.
- [Data app actions](https://ai-powered.com/skills/data-app-actions): Data app actions is an open-source agent skill for developer tools.
- [Application testing](https://ai-powered.com/skills/application-testing): Application testing is an open-source agent skill for developer tools.
- [E2E testing](https://ai-powered.com/skills/e2e-testing-fmarzochi): E2E testing is an open-source agent skill for developer tools.
- [Manual test](https://ai-powered.com/skills/manual-test-ajyadav013): Manual test is an open-source agent skill for developer tools.
- [Vitest skill](https://ai-powered.com/skills/vitest-skill): Vitest skill is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/data-app-testing
