a6cbcc273e
Made-with: Cursor
16 lines
616 B
TypeScript
16 lines
616 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('Button: тултип через портал (title), не только нативный атрибут', () => {
|
|
const src = fs.readFileSync(path.join(here, 'controls.tsx'), 'utf8');
|
|
assert.ok(src.includes('createPortal'));
|
|
assert.ok(src.includes('role="tooltip"'));
|
|
assert.ok(src.includes('onMouseEnter={showTip}'));
|
|
assert.ok(src.includes('document.body'));
|
|
});
|