import { expect } from '@playwright/test';
import {
createNote,
createShapeElement,
decreaseZoomLevel,
deleteAll,
getAllSortedIds,
Shape,
switchEditorMode,
toViewCoord,
triggerComponentToolbarAction,
} from '../utils/actions/edgeless.js';
import {
copyByKeyboard,
cutByKeyboard,
edgelessCommonSetup as commonSetup,
enterPlaygroundRoom,
expectConsoleMessage,
focusTitle,
getCurrentEditorDocId,
initEmptyEdgelessState,
mockParseDocUrlService,
pasteByKeyboard,
pasteContent,
selectAllByKeyboard,
type,
waitNextFrame,
} from '../utils/actions/index.js';
import { assertRichImage } from '../utils/asserts.js';
import { test } from '../utils/playwright.js';
test.describe('mime', () => {
test('should paste svg in text/plain mime', async ({ page }) => {
expectConsoleMessage(page, 'Error: Image sourceId is missing!', 'warning');
await commonSetup(page);
const content = {
'text/plain': `
`,
};
await pasteContent(page, content);
// wait for paste
await page.waitForTimeout(200);
await assertRichImage(page, 1);
});
test('should not paste bad svg', async ({ page }) => {
expectConsoleMessage(page, 'BlockSuiteError: val does not exist', 'error');
expectConsoleMessage(page, 'Error: Image sourceId is missing!', 'warning');
await commonSetup(page);
const contents = [
{
'text/plain': `