
Data app testing
Writes unit and Playwright tests for a Metabase data app with mocked queries and actions
Data app testing is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 20
- Last commit
- License
- AGPL-3.0
- Listing updated
Similar skills
About Data app testing
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`.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Instructions only, no scripts(see the files on GitHub)
- Asks for: Read, Write, Edit, Bash(see the files on GitHub)
- License: AGPL-3.0(see the files on GitHub)
From a static check of its 1 file (8 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
Copy the skill folder to ~/.claude/skills/data-app-testing to use it in all your projects:
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.
Copy the skill folder to ~/.agents/skills/data-app-testing to use it in every repository:
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.
Copy the skill folder to ~/.cursor/skills/data-app-testing to use it in every project:
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.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/metabase/metabase-cli.git --path packages/cli/skill-data/data-app-testingOr copy the folder to ~/.gemini/skills/data-app-testing yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/data-app-testing:
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.
Get the folder:
git clone --depth 1 https://github.com/metabase/metabase-cli.gitThen 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.
What it does
- 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
Data app testing 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.
More from metabase/metabase-cli

Guides an agent to write end-to-end tests that run the built CLI against real Metabase
- Open source
- 20 GitHub stars
- Developer tools

Plans fixtures, expectations and coverage for testing a transform's logic on known rows
- Open source
- 20 GitHub stars
- Analytics and data

Guides an agent to add a Metabase API resource across client, CLI and e2e tests
- Open source
- 20 GitHub stars
- Analytics and data

Sweeps a whole repository for architectural drift using parallel read-only review passes
- Open source
- 20 GitHub stars
- Developer tools

Runs a strict end-of-task review that flags architectural drift before work is marked done
- Open source
- 20 GitHub stars
- Developer tools

Gives agents the foundations for operating Metabase from the mb CLI
- Open source
- 20 GitHub stars
- Analytics and data


