Skip to content

Commit

Permalink
fix: label rotate (#6261)
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini authored May 31, 2024
1 parent 3ff1519 commit 45227fa
Show file tree
Hide file tree
Showing 5 changed files with 2,462 additions and 0 deletions.
25 changes: 25 additions & 0 deletions __tests__/integration/api-chart-change-size-label-rotate.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { chartChangeSizeLabelRotate as render } from '../plots/api/chart-change-size-label-rotate';
import { createNodeGCanvas } from './utils/createNodeGCanvas';
import { sleep } from './utils/sleep';
import './utils/useSnapshotMatchers';

describe('mark.changeSize', () => {
const canvas = createNodeGCanvas(640, 480);

it('mark.changeSize(width, height) should rerender expected chart', async () => {
const { finished, button, chart } = render({
canvas,
container: document.createElement('div'),
});
await finished;
button.dispatchEvent(new CustomEvent('click'));
await new Promise<void>((resolve) => chart.on('afterchangesize', resolve));
const dir = `${__dirname}/snapshots/api`;
await sleep(20);
await expect(canvas).toMatchDOMSnapshot(dir, render.name);
});

afterAll(() => {
canvas?.destroy();
});
});
Loading

0 comments on commit 45227fa

Please sign in to comment.