d228b9aab7
Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
667 B
TypeScript
21 lines
667 B
TypeScript
import assert from 'node:assert/strict';
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import test from 'node:test';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
void test('PresentationApp: Escape запрашивает confirm, не закрывает сразу', () => {
|
|
const src = fs.readFileSync(path.join(here, 'PresentationApp.tsx'), 'utf8');
|
|
assert.ok(src.includes('requestCloseMultiWindowConfirm'));
|
|
assert.match(
|
|
src,
|
|
/e\.key === 'Escape'[\s\S]*requestCloseMultiWindowConfirm/,
|
|
);
|
|
assert.doesNotMatch(
|
|
src,
|
|
/e\.key === 'Escape'[\s\S]*closeMultiWindow/,
|
|
);
|
|
});
|