Hermes 284313f908
Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Initial import of AlgaPSA codebase from PSA server
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz

Source: /opt/alga-psa on psa.joliet.tech
2026-06-22 16:12:17 -05:00

58 lines
2.2 KiB
TypeScript

import { describe, expect, test } from 'vitest';
import fs from 'fs';
import path from 'path';
const root = path.resolve(__dirname, '..');
const readJson = (filePath: string) => JSON.parse(fs.readFileSync(filePath, 'utf8'));
describe('extension scaffolding', () => {
test('manifest.json contains required fields', () => {
const manifest = readJson(path.join(root, 'manifest.json'));
expect(manifest.name).toBeTruthy();
expect(manifest.publisher).toBeTruthy();
expect(manifest.version).toBeTruthy();
expect(manifest.runtime).toBe('wasm-js@1');
});
test('manifest.json specifies iframe UI entry', () => {
const manifest = readJson(path.join(root, 'manifest.json'));
expect(manifest.ui?.type).toBe('iframe');
expect(manifest.ui?.entry).toBe('ui/index.html');
});
test('manifest.json includes appMenu hook', () => {
const manifest = readJson(path.join(root, 'manifest.json'));
expect(manifest.ui?.hooks?.appMenu?.label).toBeTruthy();
});
test('package.json includes @alga/ui-kit dependency', () => {
const pkg = readJson(path.join(root, 'package.json'));
expect(pkg.dependencies?.['@alga/ui-kit']).toContain('file:../../../../packages/ui-kit');
});
test('package.json includes react and react-dom dependencies', () => {
const pkg = readJson(path.join(root, 'package.json'));
expect(pkg.dependencies?.react).toBeTruthy();
expect(pkg.dependencies?.['react-dom']).toBeTruthy();
});
test('vite config outputs iframe bundle to ui/dist/iframe/main.js', () => {
const viteConfig = fs.readFileSync(path.join(root, 'vite.iframe.config.ts'), 'utf8');
expect(viteConfig).toContain("outDir: 'ui/dist/iframe'");
expect(viteConfig).toContain("fileName: () => 'main.js'");
});
test('vite config aliases @alga/ui-kit', () => {
const viteConfig = fs.readFileSync(path.join(root, 'vite.iframe.config.ts'), 'utf8');
expect(viteConfig).toContain("'@alga/ui-kit'");
expect(viteConfig).toContain("packages', 'ui-kit'");
});
test('index.html includes root div and loads main.js', () => {
const html = fs.readFileSync(path.join(root, 'ui/index.html'), 'utf8');
expect(html).toContain('id="root"');
expect(html).toContain('./dist/iframe/main.js');
});
});