Removes the two large legacy integration suites:
- ecosystem.integration.test.ts (9 monolithic tests, ~1900 lines,
14 occurrences of autoInvalidateOn, exercising the
APP_ORCHESTRATION_STANDARD path that is being removed).
- session-translator.test.ts (validates wireSessionTranslator,
which is also being removed).
Replaces active-app.test.ts (1072 lines, 26 tests with heavy
dependence on App.createActiveX() and publishApp* publishers) with
~200 lines of focused composition tests:
- core surface (Logger, Lang, Format, Frontend, Dom, Storage,
Http, Timers, Bus, Orca, Cache, dispose).
- locale flow (setLocale, onLocaleChange).
- mono-lang behavior (path passthrough, warn-once, |fallback).
- dispose idempotency and Orca teardown.
The new model's coverage already lives in:
- schema-declarative.test.ts — declarative App.cache / App.session
end-to-end.
- service-builder.test.ts — topology, lazy proxies, dispose.
- service-factories.test.ts — each defineActiveX wired against a
real core.
- presets.test.ts — orca actions registered via applyStandardOrca
react to SESSION_EVENT_*.
Total suite: 1383 pass (down from 1408 — the deleted legacy tests
were exercising paths that disappear entirely in the big-bang).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
master
parent
4299c3071d
commit
01a85ad299
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,43 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { createEngineBus } from '$bus';
|
||||
import {
|
||||
APP_EVENT_USER_IDENTITY_CHANGED,
|
||||
APP_USER_IDENTITY_CAUSE_SESSION_ADOPTED,
|
||||
type AppEventMap
|
||||
} from '$libs/active-app/events';
|
||||
import { SESSION_EVENT_LIFECYCLE_ADOPTED } from '$session/consts';
|
||||
import type { SessEventMap, SessLifecyclePayload } from '$session/types';
|
||||
import { publishAppIdentityFromSessionLifecycleEvent } from '../integrations/session-translator.ts';
|
||||
|
||||
describe('app session translator', () => {
|
||||
it('maps session lifecycle payloads explicitly without leaking extra sensitive fields', () => {
|
||||
const Bus = createEngineBus<AppEventMap & SessEventMap>();
|
||||
const appPayloads: unknown[] = [];
|
||||
const off = Bus.on(APP_EVENT_USER_IDENTITY_CHANGED, (event) => {
|
||||
appPayloads.push(event.payload);
|
||||
});
|
||||
|
||||
publishAppIdentityFromSessionLifecycleEvent(
|
||||
Bus,
|
||||
{
|
||||
event: SESSION_EVENT_LIFECYCLE_ADOPTED,
|
||||
generation: 1,
|
||||
identity: { from: 'none', to: 'identified' },
|
||||
credential: { token: 'secret-token' },
|
||||
headers: { authorization: 'Bearer secret-token' }
|
||||
} as unknown as SessLifecyclePayload
|
||||
);
|
||||
|
||||
expect(appPayloads).toHaveLength(1);
|
||||
expect(JSON.stringify(appPayloads[0])).not.toContain('secret-token');
|
||||
expect(appPayloads[0]).toEqual({
|
||||
event: SESSION_EVENT_LIFECYCLE_ADOPTED,
|
||||
generation: 1,
|
||||
identity: { from: 'none', to: 'identified' },
|
||||
cause: APP_USER_IDENTITY_CAUSE_SESSION_ADOPTED
|
||||
});
|
||||
|
||||
off.unsubscribe();
|
||||
Bus.dispose();
|
||||
});
|
||||
});
|
||||
Loading…
Reference in new issue