fix(editor): missing export (#10893)

This commit is contained in:
Saul-Mirone
2025-03-16 16:09:35 +00:00
parent 96add08ff4
commit 2f5e801097
2 changed files with 14 additions and 8 deletions
-1
View File
@@ -146,7 +146,6 @@
"./shared/theme": "./src/shared/theme.ts",
"./shared/types": "./src/shared/types.ts",
"./shared/utils": "./src/shared/utils.ts",
"./shared/viewport-renderer": "./src/shared/viewport-renderer.ts",
"./schemas": "./src/schemas.ts",
"./model": "./src/model/index.ts",
"./sync": "./src/sync/index.ts",
+14 -7
View File
@@ -36,6 +36,14 @@ import {
} from './utils/asserts.js';
import { test } from './utils/playwright.js';
function formatWithTimezone(date: Date, timeZone: string = 'Asia/Tokyo') {
const tokyoDate = date.toLocaleString('en-US', { timeZone });
const year = tokyoDate.split(',')[0].split('/')[2];
const month = tokyoDate.split(',')[0].split('/')[0].padStart(2, '0');
const day = tokyoDate.split(',')[0].split('/')[1];
return `${year}-${month}-${day}`;
}
test.describe('slash menu should show and hide correctly', () => {
test.beforeEach(async ({ page }) => {
await enterPlaygroundRoom(page);
@@ -681,9 +689,8 @@ test.describe('slash menu with date & time', () => {
await expect(slashMenu).toBeHidden();
const date = new Date();
const strTime = date.toISOString().split('T')[0];
await assertRichTexts(page, [strTime]);
const formattedDate = formatWithTimezone(date);
await assertRichTexts(page, [formattedDate]);
});
test("should create Tomorrow's time string", async ({ page }) => {
@@ -701,9 +708,9 @@ test.describe('slash menu with date & time', () => {
const date = new Date();
date.setDate(date.getDate() + 1);
const strTime = date.toISOString().split('T')[0];
const formattedDate = formatWithTimezone(date);
await assertRichTexts(page, [strTime]);
await assertRichTexts(page, [formattedDate]);
});
test("should insert Yesterday's time string", async ({ page }) => {
@@ -721,9 +728,9 @@ test.describe('slash menu with date & time', () => {
const date = new Date();
date.setDate(date.getDate() - 1);
const strTime = date.toISOString().split('T')[0];
const formattedDate = formatWithTimezone(date);
await assertRichTexts(page, [strTime]);
await assertRichTexts(page, [formattedDate]);
});
});