mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-26 10:45:57 +08:00
fix(editor): unify file size formatting method (#12444)
Closes: [BS-3524](https://linear.app/affine-design/issue/BS-3524/统一文件大小单位,与-af-一致)   <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated file size formatting throughout the app to use a new, consistent utility for displaying file sizes. - Improved clarity and uniformity of file size information in attachments, images, and related notifications. - Enhanced type support to explicitly allow null values for file size descriptions. - **Bug Fixes** - Adjusted file size display in tests to match updated formatting standards. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -143,7 +143,7 @@ test('can insert attachment from slash menu', async ({ page }, testInfo) => {
|
||||
await waitLoading();
|
||||
|
||||
expect(await getName()).toBe(FILE_NAME);
|
||||
expect(await getSize()).toBe('45.8 kB');
|
||||
expect(await getSize()).toBe('44.73KB');
|
||||
|
||||
expect(await getPageSnapshot(page, true)).toMatchSnapshot(
|
||||
`${testInfo.title}.json`
|
||||
@@ -285,7 +285,7 @@ test(`support dragging attachment block directly`, async ({
|
||||
await waitLoading();
|
||||
|
||||
expect(await getName()).toBe(FILE_NAME);
|
||||
expect(await getSize()).toBe('45.8 kB');
|
||||
expect(await getSize()).toBe('44.73KB');
|
||||
|
||||
expect(await getPageSnapshot(page, true)).toMatchSnapshot(
|
||||
`${testInfo.title}_1.json`
|
||||
|
||||
Reference in New Issue
Block a user