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: 2d58c5d

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: 2d58c5d

@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 2d58c5d


{#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.
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