Skip to content

Commit 826c311

Browse files
Add test
1 parent 8b936ef commit 826c311

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

docs/data/charts/export/ExportChartAsImageNoSnap.tsx.preview

Lines changed: 0 additions & 15 deletions
This file was deleted.

test/regressions/index.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,21 @@ async function main() {
294294
});
295295
});
296296
});
297+
298+
it('should export a chart as PNG', async function test() {
299+
const route = '/docs-charts-export/ExportChartAsImage';
300+
const screenshotPath = path.resolve(screenshotDir, `.${route}PNG.png`);
301+
await fse.ensureDir(path.dirname(screenshotPath));
302+
303+
await navigateToTest(route);
304+
305+
const downloadPromise = page.waitForEvent('download');
306+
await page.getByRole('button', { name: 'Print' }).click();
307+
308+
const download = await downloadPromise;
309+
310+
await download.saveAs(screenshotPath);
311+
});
297312
});
298313

299314
// describe('DateTimePicker', () => {

0 commit comments

Comments
 (0)