Skip to content

Commit

Permalink
refactor: update test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarebecca committed Dec 18, 2024
1 parent 2b2a99e commit bb4fdef
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 134 deletions.
Binary file modified packages/g6-ssr/__tests__/assets/file.pdf
Binary file not shown.
260 changes: 130 additions & 130 deletions packages/g6-ssr/__tests__/assets/file.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/g6-ssr/__tests__/assets/image.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/g6-ssr/__tests__/assets/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/g6-ssr/__tests__/assets/image_x1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed packages/g6-ssr/__tests__/assets/image_x2.jpeg
Binary file not shown.
6 changes: 3 additions & 3 deletions packages/g6-ssr/__tests__/graph.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ describe('createGraph', () => {
});

it('devicePixelRatio', async () => {
const graph = await fn('image', 'jpeg', { devicePixelRatio: 2 });
const graph = await fn('image', 'jpeg', { devicePixelRatio: 1 });

expect(graph).toMatchFile('./assets/image_x2.jpeg');
expect(graph).toMatchFile('./assets/image_x1.jpeg');

graph.exportToFile(join(__dirname, './assets/image_x2'));
graph.exportToFile(join(__dirname, './assets/image_x1'));

graph.destroy();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/g6-ssr/src/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { Options } from './types';
* @returns <zh/> [G6 画布, NodeCanvas 画布] | <en/> [G6Canvas, NodeCanvas]
*/
export function createCanvas(options: Options): [G6Canvas, NodeCanvas] {
const { width, height, background, outputType, devicePixelRatio = 1 } = options;
const { width, height, background, outputType, devicePixelRatio = 2 } = options;
const nodeCanvas = createNodeCanvas(width, height, outputType as any);
const offscreenNodeCanvas = createNodeCanvas(1, 1);

Expand Down

0 comments on commit bb4fdef

Please sign in to comment.