Skip to content
cccskills
FreePublished on GitHub

creating-visual-test-examples

Build Handsontable demo pages for visual regression tests, which compare screenshots for appearance changes. It guides feature routes, URL-driven display states, sample data, and decisions about testing the same feature across framework wrappers.

OriginalShow the original description

Use when adding or changing a demo the visual regression suite photographs - the Vite-based demo apps in examples/next/visual-tests/<framework>/demo/, the js Navigo router with one /<feature>-demo route per feature, the shared / grid that must stay identical across frameworks, and the sample-data patterns

See how to install

Good for

  • Adding a demo route for a new feature
  • Creating multiple visual states through URL parameters
  • Planning visual coverage across framework wrappers
  • Preparing sample data for screenshot tests

Files included (1)

  • SKILL.md5.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Creating Visual Test Examples

Covers the demo apps the visual suite (visual-tests/) renders: examples/next/visual-tests/{js,react-wrapper,vue3,angular-wrapper}/demo/, served on port 8082 by visual-tests/scripts/run-tests.mjs. The documentation examples in examples/next/docs/ are another tree, owned by the creating-docs-examples skill, and the visual suite does not serve it.

Decision rule

A new feature gets its own /<feature>-demo route on the js demo's router, and the shared / demo stays unchanged. A screenshot proves pixels only, so the visual spec that photographs the route is in addition to, never instead of a Playwright assertion in tests/e2e. The paragraph, the measured numbers, and the wrapper-coverage trade-off are visual-tests/AGENTS.md → Decision rule.

Example location

The js demo is one Vite app with a Navigo router (examples/next/visual-tests/js/demo/src/index.js): / renders the shared multi-feature grid (src/demos/default/), and each feature has a /<name>-demo route backed by a src/demos/<name>/ module. The wrapper demos serve / only, plus /scenario-grid in react-wrapper and angular-wrapper (vue3 has no router).

Directory structure

examples/next/visual-tests/js/demo/
  index.html          # <div id="root">
  src/
    index.js          # The Navigo router: `/` plus one `/<name>-demo` route per feature
    data.js           # Shared sample data
    utils.js          # URL helpers (theme, direction, per-route params)
    demos/
      default/        # The shared `/` grid, frozen; the multi-frameworks specs photograph it
      <name>/         # One module per feature route, exporting `init()`
    styles/           # `styles.css` for `/`, `<name>-demo.css` for a route that needs one
  spec/
    Smoke.spec.js     # Puppeteer smoke test

How to add a feature route

1. Create the module. src/demos/<feature>/index.js exports init(), which builds the grid inside #root. Read per-route options from the URL through getFromURL() in src/utils.js, so one route serves several visual states.

2. Register the route. In src/index.js, import the module and add '/<feature>-demo' next to the existing entries: removeCSS(), load the route's stylesheet (if any) and the theme through loadThemeCSS(), then call init().

3. Import from handsontable/base and register what the module needs. Do not import the full bundle into a new route:

import Handsontable from 'handsontable/base';
import { registerPlugin, ContextMenu, Filters } from 'handsontable/plugins';
import { registerCellType, NumericCellType } from 'handsontable/cellTypes';

registerPlugin(ContextMenu);
registerPlugin(Filters);
registerCellType(NumericCellType);

4. Write the visual spec under visual-tests/tests/js-only/<feature>/, navigating with goto(helpers.setBaseUrl('/<feature>-demo').getFullUrl()) (pattern: visual-testing skill).

5. Decide wrapper coverage out loud. A route exists on the js demo only, so the spec is js-only by construction. To photograph the feature under a wrapper, either extend / (every spec that photographs it re-captures on every variant, the change is declared with [visual budget: N – reason] in the pull request body, and the config is mirrored in all four demos) or add the route to react-wrapper/demo/src/index.tsx, angular-wrapper/demo/src/app/app.config.ts, and the Vue demo (no router today), a per-framework change. Trade-off: visual-tests/AGENTS.md → Decision rule.

The shared / grid

/ combines several features in one grid (column sorting + filters + dropdown menu + hidden columns + context menu, …) and the wrapper demos render the same grid. It is frozen: any change to its config that affects rendering (cell types, dateFormat, locale, formatting, data) must be mirrored in all three wrapper demos, or the js-copied baseline gotcha (visual-tests/AGENTS.md, Golden snapshots) turns it into a red nightly. Put new features on their own route.

Sample data, license, container

  • Put realistic sample data (company names, dates, currencies, countries; 20-50+ rows) in a data module (src/data.js is shared; a route can carry its own data.js).
  • Include licenseKey: 'non-commercial-and-evaluation'.
  • Mount inside #root; a route module appends its own container to it.

Smoke test

Every framework demo has spec/Smoke.spec.js, a Puppeteer test that asserts the grid rendered (await page.$('.handsontable td')). Base URL: process.env.TEST_URL || 'http://localhost:8080'.

Key reference

examples/next/visual-tests/js/demo/src/demos/default/index.js (shared grid) and src/demos/dialog/ (small single-feature route driven by URL parameters).

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Develop and modify the Handsontable Angular wrapper with guidance on component lifecycle, settings updates, and NgZone, which controls change detection. It also covers standalone examples, global configuration, and the build and test workflow.

  • Fix settings updates in the Angular wrapper
  • Review change detection around grid operations
  • Update examples to standalone components
handsontable/handsontable22.1KUpdated Oct 19, 2026

Open local or public web pages in BrowserStack Live for checks on real mobile devices or desktop browsers. The skill prepares temporary access to a local server, launches the requested session, and shares its dashboard link.

  • Check a local page on an Android device
  • Open a page in Safari on an iPhone or iPad
  • Inspect behavior in a specific desktop browser
handsontable/handsontable22.1KUpdated Oct 19, 2026

Prepare user-facing changelog entries for source code changes. The skill determines whether an entry is needed, classifies the change, writes a clear title, and uses the project CLI to create a JSON file tied to the pull request.

  • Add a changelog entry for a bug fix
  • Classify a new feature or behavior change
  • Explain a breaking change and its replacement
handsontable/handsontable22.1KUpdated Oct 19, 2026

code-graph

FreeSummary

Explore relationships between functions and files using a prebuilt code graph, a map of code dependencies. Trace bugs, inspect callers and execution paths, and assess the impact of refactoring or proposed changes.

  • Explore callers and dependencies in unfamiliar code
  • Trace a bug across multiple files
  • Assess the impact of renaming or removing code
handsontable/handsontable22.1KUpdated Oct 19, 2026

Work with Handsontable row and column positions by distinguishing source data, displayed order, and rendered cells. It guides index conversion and helps investigate misplaced data when sorting, filtering, hiding, or moving rows and columns.

  • Investigating misplaced rows or columns
  • Converting between source and displayed indexes
  • Combining filters with manual column movement
handsontable/handsontable22.1KUpdated Oct 19, 2026

Create Handsontable documentation examples for JavaScript, TypeScript, React, Angular, and Vue. The skill explains source files, generated JavaScript, required imports and license settings, embedding examples in guides, and checking that each framework version displays correctly.

  • Adding a code example to a feature guide
  • Preparing examples for multiple frameworks
  • Generating JavaScript examples from TypeScript
handsontable/handsontable22.1KUpdated Oct 19, 2026

See all skills by handsontable

Report a problem with this skill