panel-testing-strategy

Solid

Write unit and E2E tests for Grafana visualization panels and viz utilities to the conventions this repo expects. Use when adding, backfilling, or reviewing tests for panels (barchart, timeseries, table, xychart, heatmap, canvas, etc.), grafana-ui viz components (Table, uPlot, VizLegend, VizTooltip), or grafana-data viz utils; when a panel test only asserts "it rendered" or "it's defined"; when reviewing AI-generated panel tests for slop; or when a canvas/rendering test is flaky.

Testing & QA 55 stars 2 forks Updated 5 days ago MIT

Install

View on GitHub

Quality Score: 83/100

Stars 20%
58
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Panel testing strategy This skill builds on **`frontend-testing-strategy`** — read that first for the general principles every Grafana frontend test is held to (the inverted testing diamond, asserting real behavior instead of existence, avoiding AI slop, verifying a test reaches its target branch, generic anti-flake rules, and the SDLC-phase gating). This skill covers what's specific to visualization code on top of that: data-frame/panel-prop builders, the canvas draw-call snapshot harness, panel accessibility and interaction-snapshot E2E, and canvas/uPlot-specific anti-flake rules. The visualization codeowner paths are opted into the gating `check-frontend-test-coverage.yml` check, so coverage that drops fails CI. ## Step 1 — Set up data with the repo's builders Build data frames with the `@grafana/data` builders — **pick one and don't mix** `toDataFrame` and `createDataFrame` in the same file: ```ts import { createDataFrame, toDataFrame, arrayToDataFrame, FieldType, LoadingState } from '@grafana/data'; ``` Use a **single canonical builder per file** with a `Partial<>` overrides object, rather than bespoke frames per test: ```ts function makeFrame(overrides: Partial<Options> = {}) { /* … */ } ``` To render a panel component, use the shared panel-props builder instead of hand-rolling props: ```ts import { getPanelProps } from '../test-utils'; // public/app/plugins/panel/test-utils.ts render(<BarChartPanel {...getPanelProps(defaultOptions, { fieldConfig })} />); ``...

Details

Author
modem-dev
Repository
modem-dev/ossrules
Created
1 weeks ago
Last Updated
5 days ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Solid

frontend-testing-strategy

Write unit and E2E tests for Grafana frontend code (React/TypeScript, any package or feature area) to the conventions this repo expects. Use when adding, backfilling, or reviewing frontend tests; when a test only asserts "it rendered" or "it's defined"; when reviewing AI-generated tests for slop; or when a frontend test is flaky. For visualization panels and grafana-ui viz components specifically, also load the `panel-testing-strategy` skill.

55 Updated 5 days ago
modem-dev
Testing & QA Solid

frontend-testing

Scaffold and advise on frontend testing for production readiness, mapped to the Front-End-Checklist Testing category (13 rules). Defines a testing pyramid (unit, integration, E2E, visual, a11y, cross-browser, real-device, perf-budget, mutation, error-monitoring, coverage, mocking, contract) and emits copy-pasteable configs: Playwright config + smoke specs, axe a11y (jest-axe / @axe-core/playwright), Pact contract tests, and a GitHub Actions perf-budget + coverage CI. Use when the user asks for 'frontend testing', 'test strategy', 'e2e', 'visual regression', 'playwright setup', 'playwright test', 'unit test', 'integration test', 'write tests', 'test generation', 'test coverage', 'regression test', 'perf budget CI', 'accessibility testing in CI', 'contract testing', 'mutation testing', 'настрой тесты фронта', or wants tests before a release. Scaffolds & advises only — does not run your full CI; you wire the configs in. Composes with frontend-perfection, frontend-a11y, frontend-performance, /frontend.

6 Updated 2 weeks ago
bestdeejay-design
Testing & QA Listed

testing-strategy

Use when deciding what to test, at which layer, and what runs when. The E2E charter, three layers with time budgets, the when-to-run matrix, test infrastructure tiers, mechanics and conventions, the per-test quality bar for merging, what only a human can test, auditing an existing suite, and how test configs rot. A test suite is a budget, not a trophy.

0 Updated 5 days ago
konradcinkusz