fix(org-chart): improve auto connector contrast and test portability
This commit is contained in:
1 parent
d2b76e7664
commit
7644520cee
21 files changed
+109
-61
No files matched your search
@@ -1,15 +1,15 @@
|
||||
import { loadPlaywright, launchChromium } from '../../scripts/orgchart-browser-runtime.mjs';
|
||||
import http from 'node:http';
|
||||
import path from 'node:path';
|
||||
import { readFile, mkdir, writeFile } from 'node:fs/promises';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
// Verification tooling is supplied by the environment, never shipped in Core.
|
||||
const root = fileURLToPath(new URL('../../', import.meta.url));
|
||||
const output = path.join(root, 'test-results/org-chart-p1');
|
||||
await mkdir(output, { recursive: true });
|
||||
const fixture = JSON.parse(await readFile(path.join(root, 'examples/org-chart/data-p1.json'), 'utf8'));
|
||||
const modulePath = process.env.ORGCHART_PLAYWRIGHT_MODULE;
|
||||
const { chromium } = await import(modulePath ? pathToFileURL(modulePath).href : 'playwright');
|
||||
await loadPlaywright();
|
||||
const mime = { '.html': 'text/html', '.js': 'text/javascript', '.json': 'application/json', '.css': 'text/css', '.ttf': 'font/ttf', '.woff2': 'font/woff2', '.png': 'image/png', '.svg': 'image/svg+xml' };
|
||||
async function serve(directory) {
|
||||
const server = http.createServer(async (request, response) => {
|
||||
@@ -306,7 +306,7 @@ async function recheckStorybookConsole() {
|
||||
let retryBrowser;
|
||||
let sidebar;
|
||||
try {
|
||||
retryBrowser = await chromium.launch({ executablePath: process.env.ORGCHART_CHROME || 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', headless: true });
|
||||
retryBrowser = await launchChromium({ headless: true });
|
||||
const context = await retryBrowser.newContext({ viewport: { width: 1440, height: 1080 } });
|
||||
const iframe = await context.newPage();
|
||||
iframe.on('pageerror', error => retryErrors.push({ surface: 'iframe', type: 'pageerror', message: error.message }));
|
||||
@@ -361,7 +361,7 @@ try {
|
||||
const vanilla = await serve(path.join(root, 'examples/org-chart/dist')); servers.push(vanilla);
|
||||
const react = await serve(path.join(root, 'examples/org-chart-react/dist')); servers.push(react);
|
||||
const storybook = await serve(path.join(root, 'storybook-static')); servers.push(storybook);
|
||||
browser = await chromium.launch({ executablePath: process.env.ORGCHART_CHROME || 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', headless: true });
|
||||
browser = await launchChromium({ headless: true });
|
||||
const context = await browser.newContext({ viewport: { width: 1440, height: 1080 } });
|
||||
const pages = new Map();
|
||||
for (const [transport, origin] of [['vanilla', vanilla.origin], ['react', react.origin]]) {
|
||||
|
||||
Reference in new issue
Block a user