style: adopt application modules into scoped formatting

This commit is contained in:
Sameh Khamis committed 2026-09-11 17:03:35 -07:00
1 parent 4d37760314
commit 8666705e12
17 files changed
+528 -291

No files matched your search

+30 -9
View File
@@ -8,22 +8,30 @@ const urlIndex = args.indexOf('--url');
const url = urlIndex >= 0 ? args[urlIndex + 1] : 'http://localhost:4173';
const browser = await puppeteer.launch({
headless: true,
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || await puppeteer.executablePath(),
executablePath:
process.env.PUPPETEER_EXECUTABLE_PATH || (await puppeteer.executablePath()),
args: ['--no-sandbox', '--use-gl=angle', '--use-angle=swiftshader'],
});
try {
const page = await browser.newPage();
const errors = [];
page.on('console', (message) => {
if (message.type() === 'warn' && /^\[Data\].*(?:destroy|disable) error:/.test(message.text())) {
if (
message.type() === 'warn' &&
/^\[Data\].*(?:destroy|disable) error:/.test(message.text())
) {
console.log(message.text());
}
});
page.on('pageerror', (error) => errors.push(error.stack || error.message));
await page.goto(`${url}/?welcome=1`, { waitUntil: 'domcontentloaded' });
await page.waitForFunction(() => window.__godsEyeView?.voiceCommands, { timeout: 60_000 });
await page.waitForFunction(() => window.__godsEyeView?.voiceCommands, {
timeout: 60_000,
});
const before = await page.evaluate(async () => {
const entry = [...document.scripts].find((script) => /\/src\/main\.js(?:\?|$)/.test(script.src));
const entry = [...document.scripts].find((script) =>
/\/src\/main\.js(?:\?|$)/.test(script.src),
);
const { application } = await import(entry.src);
window.__qaApplication = application;
const app = window.__godsEyeView;
@@ -32,7 +40,12 @@ try {
await app.styleManager.initialRestorePromise;
const enabled = await app.dataManager.setEnabled('local-datacenters', true);
const annotation = await app.annotations.annotate([
{ type: 'pin', longitude: -97.74, latitude: 30.27, label: 'Lifecycle check' },
{
type: 'pin',
longitude: -97.74,
latitude: 30.27,
label: 'Lifecycle check',
},
]);
return {
status: application.getState().status,
@@ -49,7 +62,9 @@ try {
assert.equal(before.annotationCount, 1);
assert.equal(before.viewerAlive, true);
assert.equal(before.credits, true);
console.log('PASS: startup, data registration, annotations and visible attribution');
console.log(
'PASS: startup, data registration, annotations and visible attribution',
);
const after = await page.evaluate(async () => {
const application = window.__qaApplication;
@@ -57,7 +72,8 @@ try {
const first = application.destroy();
const samePromise = first === application.destroy();
await first.catch((error) => {
const describe = (failure) => failure.errors?.map(describe).join('; ') || failure.message;
const describe = (failure) =>
failure.errors?.map(describe).join('; ') || failure.message;
throw new Error(describe(error));
});
document.dispatchEvent(new Event('visibilitychange'));
@@ -71,7 +87,10 @@ try {
layers: app.dataManager.layers.size,
annotations: app.annotations.count(),
governor: app.getRenderGovernorDiagnostics(),
handlesRemoved: !window.__godsEyeView && !window.__gevVoiceCommands && !window.__gevAnnotations,
handlesRemoved:
!window.__godsEyeView &&
!window.__gevVoiceCommands &&
!window.__gevAnnotations,
creditsRemoved: !document.querySelector('#cesium-credits'),
welcomeHidden: !document.querySelector('#first-run-launcher.visible'),
settingsRemoved: !document.querySelector('#key-setup'),
@@ -89,7 +108,9 @@ try {
assert.equal(after.welcomeHidden, true);
assert.equal(after.settingsRemoved, true);
assert.deepEqual(errors, []);
console.log('PASS: terminal teardown releases runtime owners without late browser errors');
console.log(
'PASS: terminal teardown releases runtime owners without late browser errors',
);
} finally {
await browser.close();
}