mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
refactor(editor): use stable stringify for snapshots (#10948)
This commit is contained in:
@@ -8,6 +8,7 @@ import { uuidv4 } from '@blocksuite/affine/store';
|
||||
import type { TestAffineEditorContainer } from '@blocksuite/integration-test';
|
||||
import type { ConsoleMessage, Locator, Page } from '@playwright/test';
|
||||
import { expect } from '@playwright/test';
|
||||
import stringify from 'json-stable-stringify';
|
||||
import lz from 'lz-string';
|
||||
|
||||
import { currentEditorIndex } from '../multiple-editor.js';
|
||||
@@ -881,7 +882,7 @@ export async function getPageSnapshot(page: Page, toJSON?: boolean) {
|
||||
return snapshot.blocks;
|
||||
});
|
||||
if (toJSON) {
|
||||
return JSON.stringify(json, null, 2);
|
||||
return stringify(json, { space: ' ' });
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user