Skip to content

Conversation

@cycle4passion
Copy link

First pass testing for Arc. I'm happy for any overhaul for bigger picture.

  • Harnesses are inpackages/layerchart/src/lib/components/tests/ChartHarness.test.svelte
  • otherwise colocated tests in .../components
  • Original Component does not require any updates.
    test-lc-chart and test-lc-component are added via harness.
    • Optionally add accessory data-testid="????" in Component. I did this for data-testid="arc-track" so that I could hook onto this accessory element.
  • There are a few tests I didn't know how to write (marked and commented out).

…ture.

- Harnesses are in `packages/layerchart/src/lib/components/tests/ChartHarness.test.svelte`
- otherwise colocated tests in ..../components
- Original Component does not require any updates.
  - `test-lc-chart` and `test-lc-component` are added via harness.
  - Optionally add accessory `data-testid="????"` in Component. I did this for `data-testid="arc-track` so that I could hook onto this accessory.
- There are a few tests I didn't know how to write (marked and commented out).
@changeset-bot
Copy link

changeset-bot bot commented Jan 11, 2026

⚠️ No Changeset found

Latest commit: 35b9c38

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 11, 2026

Open in StackBlitz

npm i https://pkg.pr.new/layerchart@760

commit: 35b9c38

@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
layerchart ✅ Ready (View Log) Visit Preview 35b9c38


{#if track}
<Path
data-testid="arc-track"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could data-testid be passed via <Arc track={{ data-testid: "arc-track">` when setting up the tests instead?

});
const mergedComponentProps = $derived({
fill: 'blue',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fill: 'blue' and not needed, and we could just pass

<TestComponent {...componentProps} data-testid="test-lc-component" />

<canvas
bind:this={ref}
style:z-index={zIndex}
data-testid="canvas-layer"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this, or handled by ChartHarness?

- removed hardocded `fill-blue`
- remove data-testid from Canvas.svelte
- when needed apply

```ts
componentProps: {
  track: { 'data-testid': testId },
}
```

instead of hardcoded in original Component.
- TestHarness (Previously ChartHarness) now support snippet testing
- TestHarness supports Testing components w/o Chart (ie SimpleCharts)
…odule import, add packages to fix type errors
@techniq
Copy link
Owner

techniq commented Jan 19, 2026

Thanks for getting this started @cycle4passion!

I fixed the CI-only failure failed to fetch dynamically imported module, parallelized the CI workflow into separate steps (runs about 1 min / 25% faster), and cleaned up the old playwright test setup (since we're using vitest (and playwright as a provider))

I'm going merge this PR and continue to iterate on testing patterns more on subsequent PRs, especially on the downstream state-refactor.

Thanks again!

@techniq techniq merged commit 15537ae into techniq:docs-v2 Jan 19, 2026
7 checks passed
@techniq techniq changed the title Testing First Pass Arc Setup testing Jan 24, 2026
@techniq techniq mentioned this pull request Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants