@happyvertical/smrt-svelte 0.53.1 → 0.53.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +15 -15
- package/dist/__tests__/app-state.test.js +0 -156
- package/dist/__tests__/data-surface-bridge.test.js +0 -351
- package/dist/__tests__/provider-mode-harness.svelte +0 -14
- package/dist/__tests__/provider-mode-harness.svelte.d.ts +0 -11
- package/dist/__tests__/provider-mode-harness.svelte.d.ts.map +0 -1
- package/dist/__tests__/provider-mode-probe.svelte +0 -13
- package/dist/__tests__/provider-mode-probe.svelte.d.ts +0 -8
- package/dist/__tests__/provider-mode-probe.svelte.d.ts.map +0 -1
- package/dist/__tests__/provider-webmcp-harness.svelte +0 -14
- package/dist/__tests__/provider-webmcp-harness.svelte.d.ts +0 -8
- package/dist/__tests__/provider-webmcp-harness.svelte.d.ts.map +0 -1
- package/dist/__tests__/success-never-text.test.js +0 -100
- package/dist/__tests__/warm-clients.test.js +0 -186
- package/dist/browser-ai/adapters/llm/bitgpu-inference-backend.test.js +0 -464
- package/dist/browser-ai/adapters/llm/webllm-inference-backend.test.js +0 -646
- package/dist/browser-ai/adapters/stt/browser-speech.test.js +0 -113
- package/dist/browser-ai/adapters/stt/dictation-source.test.js +0 -52
- package/dist/browser-ai/svelte/components/__tests__/ModelStatusControl.test.js +0 -172
- package/dist/components/board/__tests__/Board.test.js +0 -498
- package/dist/components/board/__tests__/BoardSsrHarness.svelte +0 -30
- package/dist/components/board/__tests__/BoardSsrHarness.svelte.d.ts +0 -19
- package/dist/components/board/__tests__/BoardSsrHarness.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/AddressInput.behavior.test.js +0 -216
- package/dist/components/forms/__tests__/CheckboxInput.test.js +0 -92
- package/dist/components/forms/__tests__/DateRangeInput.behavior.test.js +0 -135
- package/dist/components/forms/__tests__/DateTimeInput.behavior.test.js +0 -113
- package/dist/components/forms/__tests__/FileUpload.error-alert.test.js +0 -37
- package/dist/components/forms/__tests__/FileUpload.native-form.test.js +0 -249
- package/dist/components/forms/__tests__/FileUpload.test.js +0 -90
- package/dist/components/forms/__tests__/FileUploadReset.fixture.svelte +0 -24
- package/dist/components/forms/__tests__/FileUploadReset.fixture.svelte.d.ts +0 -10
- package/dist/components/forms/__tests__/FileUploadReset.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/Form.behavior.test.js +0 -137
- package/dist/components/forms/__tests__/Form.extraction.test.js +0 -68
- package/dist/components/forms/__tests__/Form.stt-error.test.js +0 -57
- package/dist/components/forms/__tests__/Form.test.js +0 -86
- package/dist/components/forms/__tests__/Form.ui-controls.test.js +0 -119
- package/dist/components/forms/__tests__/Form.webmcp.test.js +0 -2336
- package/dist/components/forms/__tests__/FormMicButton.test.js +0 -92
- package/dist/components/forms/__tests__/FormScope.test.js +0 -39
- package/dist/components/forms/__tests__/MeasurementInput.behavior.test.js +0 -129
- package/dist/components/forms/__tests__/MoneyInput.behavior.test.js +0 -124
- package/dist/components/forms/__tests__/NumberInput.behavior.test.js +0 -151
- package/dist/components/forms/__tests__/PhoneInput.behavior.test.js +0 -96
- package/dist/components/forms/__tests__/SearchInput.test.js +0 -79
- package/dist/components/forms/__tests__/SelectInput.behavior.test.js +0 -132
- package/dist/components/forms/__tests__/TextInput.behavior.test.js +0 -131
- package/dist/components/forms/__tests__/TextareaInput.behavior.test.js +0 -96
- package/dist/components/forms/__tests__/async-invalid-field.fixture.svelte +0 -30
- package/dist/components/forms/__tests__/async-invalid-field.fixture.svelte.d.ts +0 -7
- package/dist/components/forms/__tests__/async-invalid-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/async-validation-form.fixture.svelte +0 -19
- package/dist/components/forms/__tests__/async-validation-form.fixture.svelte.d.ts +0 -9
- package/dist/components/forms/__tests__/async-validation-form.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/async-validation-snapshot-form.fixture.svelte +0 -21
- package/dist/components/forms/__tests__/async-validation-snapshot-form.fixture.svelte.d.ts +0 -8
- package/dist/components/forms/__tests__/async-validation-snapshot-form.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/composite-inputs-a11y.test.js +0 -69
- package/dist/components/forms/__tests__/compound-registration-wrapper.fixture.svelte +0 -27
- package/dist/components/forms/__tests__/compound-registration-wrapper.fixture.svelte.d.ts +0 -9
- package/dist/components/forms/__tests__/compound-registration-wrapper.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/custom-registration-field.fixture.svelte +0 -48
- package/dist/components/forms/__tests__/custom-registration-field.fixture.svelte.d.ts +0 -10
- package/dist/components/forms/__tests__/custom-registration-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-extraction-values.fixture.svelte +0 -26
- package/dist/components/forms/__tests__/form-extraction-values.fixture.svelte.d.ts +0 -13
- package/dist/components/forms/__tests__/form-extraction-values.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-registration-lifecycle.fixture.svelte +0 -52
- package/dist/components/forms/__tests__/form-registration-lifecycle.fixture.svelte.d.ts +0 -16
- package/dist/components/forms/__tests__/form-registration-lifecycle.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-scope.fixture.svelte +0 -30
- package/dist/components/forms/__tests__/form-scope.fixture.svelte.d.ts +0 -10
- package/dist/components/forms/__tests__/form-scope.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte +0 -158
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte.d.ts +0 -51
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-policy-field.fixture.svelte +0 -24
- package/dist/components/forms/__tests__/form-with-policy-field.fixture.svelte.d.ts +0 -11
- package/dist/components/forms/__tests__/form-with-policy-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-structured-fields.fixture.svelte +0 -105
- package/dist/components/forms/__tests__/form-with-structured-fields.fixture.svelte.d.ts +0 -42
- package/dist/components/forms/__tests__/form-with-structured-fields.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-ui-controls.fixture.svelte +0 -84
- package/dist/components/forms/__tests__/form-with-ui-controls.fixture.svelte.d.ts +0 -14
- package/dist/components/forms/__tests__/form-with-ui-controls.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/legacy-form-context.fixture.svelte +0 -44
- package/dist/components/forms/__tests__/legacy-form-context.fixture.svelte.d.ts +0 -9
- package/dist/components/forms/__tests__/legacy-form-context.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/mic-keyboard-a11y.test.js +0 -74
- package/dist/components/forms/__tests__/policy-field.fixture.svelte +0 -35
- package/dist/components/forms/__tests__/policy-field.fixture.svelte.d.ts +0 -8
- package/dist/components/forms/__tests__/policy-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/rich-inputs-a11y.test.js +0 -87
- package/dist/components/settings/__tests__/SettingsCatalog.test.js +0 -69
- package/dist/components/settings/__tests__/catalog.test.js +0 -46
- package/dist/components/workspace/__tests__/AdminShell.responsive.test.js +0 -597
- package/dist/components/workspace/__tests__/AdminShell.test.js +0 -572
- package/dist/components/workspace/__tests__/RoleShell.test.js +0 -772
- package/dist/components/workspace/__tests__/TenantNav.test.js +0 -208
- package/dist/components/workspace/__tests__/WorkspaceAccountMenu.test.js +0 -79
- package/dist/components/workspace/__tests__/WorkspaceShell.test.js +0 -630
- package/dist/components/workspace/__tests__/admin-shell-header-overflow.test.js +0 -25
- package/dist/components/workspace/__tests__/admin-shell-hotkeys.test.js +0 -34
- package/dist/components/workspace/__tests__/admin-shell-mobile.test.js +0 -217
- package/dist/components/workspace/__tests__/admin-shell-mutation-effect-harness.svelte +0 -52
- package/dist/components/workspace/__tests__/admin-shell-mutation-effect-harness.svelte.d.ts +0 -23
- package/dist/components/workspace/__tests__/admin-shell-mutation-effect-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/admin-shell-page-contracts.test.js +0 -30
- package/dist/components/workspace/__tests__/admin-shell-responsive-state.test.js +0 -184
- package/dist/components/workspace/__tests__/admin-shell-settings.test.js +0 -25
- package/dist/components/workspace/__tests__/admin-shell-state.test.js +0 -286
- package/dist/components/workspace/__tests__/admin-shell-theme-hooks.test.js +0 -36
- package/dist/components/workspace/__tests__/breadcrumbs-helpers.test.js +0 -141
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte +0 -45
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte.d.ts +0 -21
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/define-tools-dock.test.js +0 -1188
- package/dist/components/workspace/__tests__/harness.svelte +0 -25
- package/dist/components/workspace/__tests__/harness.svelte.d.ts +0 -14
- package/dist/components/workspace/__tests__/harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/index.test.js +0 -28
- package/dist/components/workspace/__tests__/legacy-index.test.js +0 -9
- package/dist/components/workspace/__tests__/manifest-nav-helpers.test.js +0 -24
- package/dist/components/workspace/__tests__/manifest-nav.test.js +0 -599
- package/dist/components/workspace/__tests__/nav-helpers.test.js +0 -95
- package/dist/components/workspace/__tests__/render-harness.svelte +0 -66
- package/dist/components/workspace/__tests__/render-harness.svelte.d.ts +0 -32
- package/dist/components/workspace/__tests__/render-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/render-tools-dock.test.js +0 -260
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte +0 -58
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte.d.ts +0 -16
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte +0 -41
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte.d.ts +0 -13
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/shell-chrome-components.test.js +0 -108
- package/dist/components/workspace/__tests__/system-feed.test.js +0 -327
- package/dist/components/workspace/__tests__/test-icon.svelte +0 -17
- package/dist/components/workspace/__tests__/test-icon.svelte.d.ts +0 -19
- package/dist/components/workspace/__tests__/test-icon.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte +0 -38
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte.d.ts +0 -22
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts +0 -66
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.js +0 -115
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.d.ts +0 -15
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.js +0 -7
- package/dist/components/workspace/__tests__/typed-tool-fixture.test.js +0 -115
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte +0 -9
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte.d.ts +0 -19
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/use-harness.svelte +0 -23
- package/dist/components/workspace/__tests__/use-harness.svelte.d.ts +0 -8
- package/dist/components/workspace/__tests__/use-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/use-tools-dock.test.js +0 -33
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte +0 -43
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte.d.ts +0 -11
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/server/__tests__/compose-availability.test.js +0 -383
- package/dist/components/workspace/server/__tests__/typed-context-fixture.d.ts +0 -78
- package/dist/components/workspace/server/__tests__/typed-context-fixture.d.ts.map +0 -1
- package/dist/components/workspace/server/__tests__/typed-context-fixture.js +0 -104
- package/dist/hooks/__tests__/stt-consumer.fixture.svelte +0 -25
- package/dist/hooks/__tests__/stt-consumer.fixture.svelte.d.ts +0 -15
- package/dist/hooks/__tests__/stt-consumer.fixture.svelte.d.ts.map +0 -1
- package/dist/hooks/__tests__/stt-ownership-harness.svelte +0 -42
- package/dist/hooks/__tests__/stt-ownership-harness.svelte.d.ts +0 -20
- package/dist/hooks/__tests__/stt-ownership-harness.svelte.d.ts.map +0 -1
- package/dist/hooks/__tests__/useSTT-ownership.test.js +0 -102
- package/dist/i18n/__tests__/server.spec.js +0 -57
- package/dist/internal/logger.test.js +0 -54
- package/dist/provider-mode.test.js +0 -86
- package/dist/provider-webmcp.test.js +0 -244
- package/dist/state/__tests__/app-state-ai-lifecycle.test.js +0 -240
- package/dist/state/__tests__/warm-clients.test.js +0 -40
- package/dist/web/__tests__/activity-feed-harness.svelte +0 -32
- package/dist/web/__tests__/activity-feed-harness.svelte.d.ts +0 -18
- package/dist/web/__tests__/activity-feed-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/activity-feed.integration.svelte.test.js +0 -190
- package/dist/web/__tests__/activity-feed.svelte.test.js +0 -235
- package/dist/web/__tests__/assistant-dock.integration.svelte.test.js +0 -204
- package/dist/web/__tests__/data-surface-conformance.integration.svelte.test.js +0 -1392
- package/dist/web/__tests__/harness.svelte +0 -25
- package/dist/web/__tests__/harness.svelte.d.ts +0 -15
- package/dist/web/__tests__/harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/list-data-surface.fixture.svelte +0 -59
- package/dist/web/__tests__/list-data-surface.fixture.svelte.d.ts +0 -14
- package/dist/web/__tests__/list-data-surface.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/list-data-surface.svelte.test.js +0 -106
- package/dist/web/__tests__/list-data-surface.test.js +0 -651
- package/dist/web/__tests__/list-sort-surface.fixture.svelte +0 -41
- package/dist/web/__tests__/list-sort-surface.fixture.svelte.d.ts +0 -15
- package/dist/web/__tests__/list-sort-surface.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/list-sort-surface.svelte.test.js +0 -59
- package/dist/web/__tests__/live-collection.svelte.test.js +0 -185
- package/dist/web/__tests__/provider-ui-registry.fixture.svelte +0 -43
- package/dist/web/__tests__/provider-ui-registry.fixture.svelte.d.ts +0 -13
- package/dist/web/__tests__/provider-ui-registry.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/provider-ui-registry.test.js +0 -235
- package/dist/web/__tests__/remote-query-harness.svelte +0 -27
- package/dist/web/__tests__/remote-query-harness.svelte.d.ts +0 -11
- package/dist/web/__tests__/remote-query-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/remote-query.svelte.test.js +0 -101
- package/dist/web/__tests__/surfaces.child.fixture.svelte +0 -69
- package/dist/web/__tests__/surfaces.child.fixture.svelte.d.ts +0 -16
- package/dist/web/__tests__/surfaces.child.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/surfaces.fixture.svelte +0 -26
- package/dist/web/__tests__/surfaces.fixture.svelte.d.ts +0 -18
- package/dist/web/__tests__/surfaces.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/surfaces.svelte.test.js +0 -140
- package/dist/web/__tests__/update-available-harness.svelte +0 -46
- package/dist/web/__tests__/update-available-harness.svelte.d.ts +0 -22
- package/dist/web/__tests__/update-available-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/update-available.svelte.test.js +0 -137
- package/dist/web/__tests__/view-intent-provider.fixture.svelte +0 -28
- package/dist/web/__tests__/view-intent-provider.fixture.svelte.d.ts +0 -13
- package/dist/web/__tests__/view-intent-provider.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/view-intent.fixture.svelte +0 -33
- package/dist/web/__tests__/view-intent.fixture.svelte.d.ts +0 -15
- package/dist/web/__tests__/view-intent.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/view-intent.intents.d.ts +0 -14
- package/dist/web/__tests__/view-intent.intents.d.ts.map +0 -1
- package/dist/web/__tests__/view-intent.intents.js +0 -38
- package/dist/web/__tests__/view-intent.svelte.test.js +0 -244
- package/dist/web/__tests__/webmcp-composed.child.fixture.svelte +0 -73
- package/dist/web/__tests__/webmcp-composed.child.fixture.svelte.d.ts +0 -8
- package/dist/web/__tests__/webmcp-composed.child.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-composed.fixture.svelte +0 -52
- package/dist/web/__tests__/webmcp-composed.fixture.svelte.d.ts +0 -12
- package/dist/web/__tests__/webmcp-composed.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-composed.integration.svelte.test.js +0 -251
- package/dist/web/__tests__/webmcp-effects-reactivity.child.fixture.svelte +0 -16
- package/dist/web/__tests__/webmcp-effects-reactivity.child.fixture.svelte.d.ts +0 -19
- package/dist/web/__tests__/webmcp-effects-reactivity.child.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-effects-reactivity.fixture.svelte +0 -11
- package/dist/web/__tests__/webmcp-effects-reactivity.fixture.svelte.d.ts +0 -8
- package/dist/web/__tests__/webmcp-effects-reactivity.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-harness-reactive-samename.svelte +0 -20
- package/dist/web/__tests__/webmcp-harness-reactive-samename.svelte.d.ts +0 -7
- package/dist/web/__tests__/webmcp-harness-reactive-samename.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-harness-unannotated.svelte +0 -14
- package/dist/web/__tests__/webmcp-harness-unannotated.svelte.d.ts +0 -19
- package/dist/web/__tests__/webmcp-harness-unannotated.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-harness.svelte +0 -18
- package/dist/web/__tests__/webmcp-harness.svelte.d.ts +0 -7
- package/dist/web/__tests__/webmcp-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-ssr.fixture.svelte +0 -13
- package/dist/web/__tests__/webmcp-ssr.fixture.svelte.d.ts +0 -19
- package/dist/web/__tests__/webmcp-ssr.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-ui.test.js +0 -723
- package/dist/web/__tests__/webmcp.test.js +0 -234
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import { flushSync, mount, unmount } from 'svelte';
|
|
2
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
-
import { createShellState } from '../admin-shell/state.svelte.js';
|
|
4
|
-
import MutationEffectHarness from './admin-shell-mutation-effect-harness.svelte';
|
|
5
|
-
function mountMutationEffect(shell, run) {
|
|
6
|
-
const target = document.createElement('div');
|
|
7
|
-
document.body.appendChild(target);
|
|
8
|
-
let getRuns = () => 0;
|
|
9
|
-
let setActivityProgress = (_progress) => { };
|
|
10
|
-
const component = mount(MutationEffectHarness, {
|
|
11
|
-
target,
|
|
12
|
-
props: {
|
|
13
|
-
shell,
|
|
14
|
-
run,
|
|
15
|
-
onReady: (controls) => {
|
|
16
|
-
getRuns = controls.getRuns;
|
|
17
|
-
setActivityProgress = controls.setActivityProgress;
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
return {
|
|
22
|
-
getRuns,
|
|
23
|
-
setActivityProgress,
|
|
24
|
-
teardown: () => {
|
|
25
|
-
unmount(component);
|
|
26
|
-
target.remove();
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
describe('ShellState', () => {
|
|
31
|
-
it('persists runtime hide/show and restores hidden preferences on hydration', async () => {
|
|
32
|
-
const write = vi.fn();
|
|
33
|
-
const shell = createShellState({
|
|
34
|
-
settingsAdapter: { read: () => null, write },
|
|
35
|
-
});
|
|
36
|
-
shell.setPanelState('left', 'hidden');
|
|
37
|
-
expect(shell.panels.left).toBe('hidden');
|
|
38
|
-
expect(write).toHaveBeenLastCalledWith(expect.objectContaining({ panels: { left: 'hidden' } }));
|
|
39
|
-
const restored = createShellState({
|
|
40
|
-
settingsAdapter: { read: () => shell.snapshot().settings, write },
|
|
41
|
-
});
|
|
42
|
-
await restored.hydrate();
|
|
43
|
-
expect(restored.panels.left).toBe('hidden');
|
|
44
|
-
restored.setPanelState('left', 'expanded');
|
|
45
|
-
expect(restored.panels.left).toBe('expanded');
|
|
46
|
-
restored.setPanelState('left', 'collapsed');
|
|
47
|
-
expect(restored.panels.left).toBe('collapsed');
|
|
48
|
-
});
|
|
49
|
-
it('keeps app-disabled edges hidden and rejects unknown runtime panel states', () => {
|
|
50
|
-
const shell = createShellState({ config: { right: false } });
|
|
51
|
-
shell.setPanelState('right', 'expanded');
|
|
52
|
-
expect(shell.panels.right).toBe('hidden');
|
|
53
|
-
shell.setPanelState('left', 'unknown');
|
|
54
|
-
expect(shell.panels.left).toBe('collapsed');
|
|
55
|
-
});
|
|
56
|
-
it('allows panels to expand independently by default', () => {
|
|
57
|
-
const shell = createShellState();
|
|
58
|
-
shell.expandPanel('top');
|
|
59
|
-
shell.expandPanel('bottom');
|
|
60
|
-
expect(shell.panels.top).toBe('expanded');
|
|
61
|
-
expect(shell.panels.bottom).toBe('expanded');
|
|
62
|
-
});
|
|
63
|
-
it('closes peers in the same exclusivity group', () => {
|
|
64
|
-
const shell = createShellState({
|
|
65
|
-
config: {
|
|
66
|
-
top: { exclusiveGroup: 'vertical' },
|
|
67
|
-
bottom: { exclusiveGroup: 'vertical' },
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
shell.expandPanel('top');
|
|
71
|
-
shell.expandPanel('bottom');
|
|
72
|
-
expect(shell.panels.top).toBe('collapsed');
|
|
73
|
-
expect(shell.panels.bottom).toBe('expanded');
|
|
74
|
-
});
|
|
75
|
-
it('registers and unregisters focus tools', () => {
|
|
76
|
-
const shell = createShellState();
|
|
77
|
-
const unregister = shell.registerFocusTool({
|
|
78
|
-
id: 'activity',
|
|
79
|
-
label: 'Activity',
|
|
80
|
-
});
|
|
81
|
-
expect(shell.focusTools.map((tool) => tool.id)).toEqual(['activity']);
|
|
82
|
-
expect(shell.activeFocusToolId).toBe('activity');
|
|
83
|
-
unregister();
|
|
84
|
-
expect(shell.focusTools).toEqual([]);
|
|
85
|
-
expect(shell.activeFocusToolId).toBeNull();
|
|
86
|
-
});
|
|
87
|
-
it('re-homes activities to system when their edge is hidden', () => {
|
|
88
|
-
const shell = createShellState({ config: { right: false } });
|
|
89
|
-
shell.upsertActivity({
|
|
90
|
-
id: 'encode-1',
|
|
91
|
-
label: 'Encode',
|
|
92
|
-
kind: 'video-encode',
|
|
93
|
-
scope: 'focus',
|
|
94
|
-
status: 'running',
|
|
95
|
-
});
|
|
96
|
-
expect(shell.listActivities()[0]?.edge).toBe('bottom');
|
|
97
|
-
expect(shell.activityBadge('bottom').count).toBe(1);
|
|
98
|
-
});
|
|
99
|
-
it('emits lifecycle events for activity updates', () => {
|
|
100
|
-
const shell = createShellState();
|
|
101
|
-
const listener = vi.fn();
|
|
102
|
-
shell.watchActivities(listener);
|
|
103
|
-
shell.upsertActivity({
|
|
104
|
-
id: 'import-1',
|
|
105
|
-
label: 'Import',
|
|
106
|
-
kind: 'import',
|
|
107
|
-
scope: 'system',
|
|
108
|
-
status: 'running',
|
|
109
|
-
});
|
|
110
|
-
shell.updateActivity('import-1', { status: 'completed' });
|
|
111
|
-
expect(listener).toHaveBeenCalledWith(expect.objectContaining({ type: 'transition' }));
|
|
112
|
-
});
|
|
113
|
-
it('keeps an exclusivity-closed peer collapsed after settings re-resolve', () => {
|
|
114
|
-
const shell = createShellState({
|
|
115
|
-
config: {
|
|
116
|
-
top: { exclusiveGroup: 'vertical' },
|
|
117
|
-
bottom: { exclusiveGroup: 'vertical' },
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
shell.expandPanel('top');
|
|
121
|
-
shell.expandPanel('bottom');
|
|
122
|
-
// Re-applying settings (as hydrate / app-default changes do) must not
|
|
123
|
-
// resurrect the peer the exclusivity rule collapsed.
|
|
124
|
-
shell.applySettings({});
|
|
125
|
-
expect(shell.panels.top).toBe('collapsed');
|
|
126
|
-
expect(shell.panels.bottom).toBe('expanded');
|
|
127
|
-
});
|
|
128
|
-
it('re-homes to a visible edge when both the scope edge and system are hidden', () => {
|
|
129
|
-
const shell = createShellState({ config: { right: false, bottom: false } });
|
|
130
|
-
shell.upsertActivity({
|
|
131
|
-
id: 'encode-2',
|
|
132
|
-
label: 'Encode',
|
|
133
|
-
kind: 'video-encode',
|
|
134
|
-
scope: 'focus',
|
|
135
|
-
status: 'running',
|
|
136
|
-
});
|
|
137
|
-
const edge = shell.listActivities()[0]?.edge;
|
|
138
|
-
expect(edge).toBeDefined();
|
|
139
|
-
expect(shell.panels[edge]).not.toBe('hidden');
|
|
140
|
-
});
|
|
141
|
-
it('flags progress-only updates as upsert with a previous snapshot', () => {
|
|
142
|
-
const shell = createShellState();
|
|
143
|
-
const events = [];
|
|
144
|
-
shell.watchActivities((event) => {
|
|
145
|
-
if (event.type !== 'remove') {
|
|
146
|
-
events.push(`${event.type}:${event.previous ? 'has-prev' : 'new'}`);
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
shell.upsertActivity({
|
|
150
|
-
id: 'encode-3',
|
|
151
|
-
label: 'Encode',
|
|
152
|
-
kind: 'video-encode',
|
|
153
|
-
scope: 'system',
|
|
154
|
-
status: 'running',
|
|
155
|
-
progress: 10,
|
|
156
|
-
});
|
|
157
|
-
shell.updateActivity('encode-3', { progress: 40 });
|
|
158
|
-
// A new activity is a notify-worthy "started"; a progress-only tick is an
|
|
159
|
-
// upsert carrying `previous`, which the toaster filters out.
|
|
160
|
-
expect(events).toEqual(['upsert:new', 'upsert:has-prev']);
|
|
161
|
-
});
|
|
162
|
-
it('does not leak focus-tool state reads into consumer effects', () => {
|
|
163
|
-
const shell = createShellState();
|
|
164
|
-
const harness = mountMutationEffect(shell, (state) => {
|
|
165
|
-
const unregister = state.registerFocusTool({
|
|
166
|
-
id: 'activity',
|
|
167
|
-
label: 'Activity',
|
|
168
|
-
});
|
|
169
|
-
state.openFocusTool('activity');
|
|
170
|
-
return unregister;
|
|
171
|
-
});
|
|
172
|
-
try {
|
|
173
|
-
flushSync();
|
|
174
|
-
expect(harness.getRuns()).toBe(1);
|
|
175
|
-
shell.collapsePanel('right');
|
|
176
|
-
flushSync();
|
|
177
|
-
shell.openFocusTool('activity');
|
|
178
|
-
flushSync();
|
|
179
|
-
expect(harness.getRuns()).toBe(1);
|
|
180
|
-
expect(shell.focusTools.map((tool) => tool.id)).toEqual(['activity']);
|
|
181
|
-
}
|
|
182
|
-
finally {
|
|
183
|
-
harness.teardown();
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
it('keeps imperative open idempotent and toggles only through toggleFocusTool', () => {
|
|
187
|
-
const shell = createShellState();
|
|
188
|
-
shell.registerFocusTool({ id: 'chat', label: 'Chat' });
|
|
189
|
-
shell.openFocusTool('chat');
|
|
190
|
-
expect(shell.panels.right).toBe('expanded');
|
|
191
|
-
expect(shell.activeFocusToolId).toBe('chat');
|
|
192
|
-
// Imperative callers can safely ensure that a tool is open.
|
|
193
|
-
shell.openFocusTool('chat');
|
|
194
|
-
expect(shell.panels.right).toBe('expanded');
|
|
195
|
-
expect(shell.activeFocusToolId).toBe('chat');
|
|
196
|
-
// Rail clicks use the explicit toggle operation.
|
|
197
|
-
shell.toggleFocusTool('chat');
|
|
198
|
-
expect(shell.panels.right).toBe('collapsed');
|
|
199
|
-
shell.toggleFocusTool('chat');
|
|
200
|
-
expect(shell.panels.right).toBe('expanded');
|
|
201
|
-
// Switching tools never collapses.
|
|
202
|
-
shell.registerFocusTool({ id: 'files', label: 'Files' });
|
|
203
|
-
shell.openFocusTool('files');
|
|
204
|
-
expect(shell.panels.right).toBe('expanded');
|
|
205
|
-
expect(shell.activeFocusToolId).toBe('files');
|
|
206
|
-
});
|
|
207
|
-
it('does not leak panel state reads into consumer effects', () => {
|
|
208
|
-
const shell = createShellState();
|
|
209
|
-
const harness = mountMutationEffect(shell, (state) => {
|
|
210
|
-
state.setPanel('right', 'expanded');
|
|
211
|
-
return undefined;
|
|
212
|
-
});
|
|
213
|
-
try {
|
|
214
|
-
flushSync();
|
|
215
|
-
expect(harness.getRuns()).toBe(1);
|
|
216
|
-
shell.togglePanel('right');
|
|
217
|
-
flushSync();
|
|
218
|
-
expect(harness.getRuns()).toBe(1);
|
|
219
|
-
expect(shell.panels.right).toBe('collapsed');
|
|
220
|
-
}
|
|
221
|
-
finally {
|
|
222
|
-
harness.teardown();
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
it('does not leak settings state reads into consumer effects', () => {
|
|
226
|
-
const shell = createShellState();
|
|
227
|
-
const harness = mountMutationEffect(shell, (state) => {
|
|
228
|
-
state.applySettings({ panels: { right: 'expanded' } });
|
|
229
|
-
return undefined;
|
|
230
|
-
});
|
|
231
|
-
try {
|
|
232
|
-
flushSync();
|
|
233
|
-
expect(harness.getRuns()).toBe(1);
|
|
234
|
-
shell.setHotkey('right', 'KeyR');
|
|
235
|
-
flushSync();
|
|
236
|
-
expect(harness.getRuns()).toBe(1);
|
|
237
|
-
expect(shell.settings.keymap?.right).toEqual({ code: 'KeyR' });
|
|
238
|
-
}
|
|
239
|
-
finally {
|
|
240
|
-
harness.teardown();
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
it('does not leak activity state reads into consumer effects', () => {
|
|
244
|
-
const shell = createShellState();
|
|
245
|
-
const harness = mountMutationEffect(shell, (state) => {
|
|
246
|
-
state.upsertActivity({
|
|
247
|
-
id: 'sync-1',
|
|
248
|
-
label: 'Sync',
|
|
249
|
-
kind: 'sync',
|
|
250
|
-
scope: 'system',
|
|
251
|
-
status: 'running',
|
|
252
|
-
});
|
|
253
|
-
return undefined;
|
|
254
|
-
});
|
|
255
|
-
try {
|
|
256
|
-
flushSync();
|
|
257
|
-
expect(harness.getRuns()).toBe(1);
|
|
258
|
-
shell.updateActivity('sync-1', { progress: 50 });
|
|
259
|
-
flushSync();
|
|
260
|
-
expect(harness.getRuns()).toBe(1);
|
|
261
|
-
expect(shell.listActivities()[0]?.progress).toBe(50);
|
|
262
|
-
}
|
|
263
|
-
finally {
|
|
264
|
-
harness.teardown();
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
it('keeps caller-supplied reactive activity inputs tracked', () => {
|
|
268
|
-
const shell = createShellState();
|
|
269
|
-
const harness = mountMutationEffect(shell, (state, inputs) => {
|
|
270
|
-
state.upsertActivity(inputs.activity);
|
|
271
|
-
return undefined;
|
|
272
|
-
});
|
|
273
|
-
try {
|
|
274
|
-
flushSync();
|
|
275
|
-
expect(harness.getRuns()).toBe(1);
|
|
276
|
-
expect(shell.listActivities()[0]?.progress).toBe(0);
|
|
277
|
-
harness.setActivityProgress(75);
|
|
278
|
-
flushSync();
|
|
279
|
-
expect(harness.getRuns()).toBe(2);
|
|
280
|
-
expect(shell.listActivities()[0]?.progress).toBe(75);
|
|
281
|
-
}
|
|
282
|
-
finally {
|
|
283
|
-
harness.teardown();
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An app themes the shell through custom properties instead of restyling its
|
|
3
|
-
* internal classes: the page background, themed thin scrollbars, the shell
|
|
4
|
-
* title's font family, and a right rail that never pads wider than its track.
|
|
5
|
-
*/
|
|
6
|
-
import { readFileSync } from 'node:fs';
|
|
7
|
-
import { join } from 'node:path';
|
|
8
|
-
import { describe, expect, it } from 'vitest';
|
|
9
|
-
const packageRoot = process.cwd().endsWith('packages/smrt-svelte')
|
|
10
|
-
? process.cwd()
|
|
11
|
-
: join(process.cwd(), 'packages/smrt-svelte');
|
|
12
|
-
const shellDir = join(packageRoot, 'src/components/workspace/admin-shell');
|
|
13
|
-
const shell = readFileSync(join(shellDir, 'AdminShell.svelte'), 'utf8');
|
|
14
|
-
const title = readFileSync(join(shellDir, 'ShellTitle.svelte'), 'utf8');
|
|
15
|
-
function ruleBody(source, selector) {
|
|
16
|
-
const start = source.indexOf(`${selector} {`);
|
|
17
|
-
expect(start).toBeGreaterThan(-1);
|
|
18
|
-
return source.slice(start, source.indexOf('\n }', start));
|
|
19
|
-
}
|
|
20
|
-
describe('AdminShell theme hooks', () => {
|
|
21
|
-
it('reads its page background from --smrt-admin-shell-background', () => {
|
|
22
|
-
expect(ruleBody(shell, '.smrt-admin-shell')).toMatch(/background:\s*var\(--smrt-admin-shell-background,\s*var\(--smrt-color-surface\)\)/);
|
|
23
|
-
});
|
|
24
|
-
it('themes thin scrollbars from tokens, overridable per app', () => {
|
|
25
|
-
const root = ruleBody(shell, '.smrt-admin-shell');
|
|
26
|
-
expect(root).toMatch(/scrollbar-color:[^;]*--smrt-admin-shell-scrollbar-thumb[^;]*--smrt-admin-shell-scrollbar-track/s);
|
|
27
|
-
expect(ruleBody(shell, '.smrt-admin-shell :global(*)')).toMatch(/scrollbar-width:\s*thin/);
|
|
28
|
-
expect(shell).toContain('--smrt-admin-shell-scrollbar-thumb-hover');
|
|
29
|
-
});
|
|
30
|
-
it('keeps a right rail collapsed to 0 from painting padding', () => {
|
|
31
|
-
expect(ruleBody(shell, '.smrt-admin-shell__edge--right .smrt-admin-shell__rail')).toMatch(/padding-inline:\s*min\(\s*var\(--smrt-spacing-3\),\s*calc\(var\(--smrt-admin-shell-right-collapsed\) \/ 4\)/);
|
|
32
|
-
});
|
|
33
|
-
it('lets an app set the shell title font family', () => {
|
|
34
|
-
expect(ruleBody(title, '.smrt-shell-title')).toMatch(/font-family:\s*var\(--smrt-shell-title-font-family/);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for Breadcrumbs' pure derivation helpers.
|
|
3
|
-
*
|
|
4
|
-
* The Svelte component is a thin renderer over `deriveCrumbsFromNav`,
|
|
5
|
-
* so testing the helper covers:
|
|
6
|
-
* - explicit pass-through (handled in the component layer)
|
|
7
|
-
* - auto mode: nav-tree label lookup
|
|
8
|
-
* - fallback to capitalized segments for unknown paths
|
|
9
|
-
* - `rootCrumb` prepend
|
|
10
|
-
* - `startAfter` segment skipping
|
|
11
|
-
*/
|
|
12
|
-
import { describe, expect, it } from 'vitest';
|
|
13
|
-
import { capitalizeSegment, deriveCrumbsFromNav, findLabelInNav, } from '../breadcrumbs-helpers.js';
|
|
14
|
-
const nav = [
|
|
15
|
-
{
|
|
16
|
-
href: '/content',
|
|
17
|
-
label: 'Content',
|
|
18
|
-
children: [
|
|
19
|
-
{ href: '/content/articles', label: 'Articles' },
|
|
20
|
-
{
|
|
21
|
-
href: '/content/media',
|
|
22
|
-
label: 'Media library',
|
|
23
|
-
children: [{ href: '/content/media/images', label: 'Images' }],
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
];
|
|
28
|
-
describe('findLabelInNav', () => {
|
|
29
|
-
it('finds a top-level label', () => {
|
|
30
|
-
expect(findLabelInNav(nav, '/content')).toBe('Content');
|
|
31
|
-
});
|
|
32
|
-
it('finds a nested label', () => {
|
|
33
|
-
expect(findLabelInNav(nav, '/content/media/images')).toBe('Images');
|
|
34
|
-
});
|
|
35
|
-
it('returns null when not found', () => {
|
|
36
|
-
expect(findLabelInNav(nav, '/missing')).toBeNull();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
describe('capitalizeSegment', () => {
|
|
40
|
-
it('uppercases the first letter', () => {
|
|
41
|
-
expect(capitalizeSegment('articles')).toBe('Articles');
|
|
42
|
-
});
|
|
43
|
-
it('replaces dashes and underscores with spaces', () => {
|
|
44
|
-
expect(capitalizeSegment('my-cool-section')).toBe('My cool section');
|
|
45
|
-
expect(capitalizeSegment('snake_case_thing')).toBe('Snake case thing');
|
|
46
|
-
});
|
|
47
|
-
it('handles empty input gracefully', () => {
|
|
48
|
-
expect(capitalizeSegment('')).toBe('');
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
describe('deriveCrumbsFromNav', () => {
|
|
52
|
-
it('builds crumbs from nav matches', () => {
|
|
53
|
-
const crumbs = deriveCrumbsFromNav('/content/articles', nav);
|
|
54
|
-
expect(crumbs).toEqual([
|
|
55
|
-
{ label: 'Content', href: '/content' },
|
|
56
|
-
{ label: 'Articles', href: '/content/articles' },
|
|
57
|
-
]);
|
|
58
|
-
});
|
|
59
|
-
it('falls back to capitalized segments for unknown paths', () => {
|
|
60
|
-
const crumbs = deriveCrumbsFromNav('/content/random-thing', nav);
|
|
61
|
-
expect(crumbs).toEqual([
|
|
62
|
-
{ label: 'Content', href: '/content' },
|
|
63
|
-
{ label: 'Random thing', href: '/content/random-thing' },
|
|
64
|
-
]);
|
|
65
|
-
});
|
|
66
|
-
it('disables capitalization when capitalize=false', () => {
|
|
67
|
-
const crumbs = deriveCrumbsFromNav('/content/random-thing', nav, {
|
|
68
|
-
capitalize: false,
|
|
69
|
-
});
|
|
70
|
-
expect(crumbs[1]).toEqual({
|
|
71
|
-
label: 'random-thing',
|
|
72
|
-
href: '/content/random-thing',
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
it('prepends rootCrumb', () => {
|
|
76
|
-
const crumbs = deriveCrumbsFromNav('/content', nav, {
|
|
77
|
-
rootCrumb: { label: 'My Site', href: '/' },
|
|
78
|
-
});
|
|
79
|
-
expect(crumbs[0]).toEqual({ label: 'My Site', href: '/' });
|
|
80
|
-
expect(crumbs[1]).toEqual({ label: 'Content', href: '/content' });
|
|
81
|
-
});
|
|
82
|
-
it('skips segments before startAfter and resolves remaining against nav', () => {
|
|
83
|
-
const siteNav = [
|
|
84
|
-
{
|
|
85
|
-
href: '/sites/foo/content',
|
|
86
|
-
label: 'Content',
|
|
87
|
-
children: [{ href: '/sites/foo/content/articles', label: 'Articles' }],
|
|
88
|
-
},
|
|
89
|
-
];
|
|
90
|
-
const crumbs = deriveCrumbsFromNav('/sites/foo/content/articles', siteNav, {
|
|
91
|
-
rootCrumb: { label: 'Foo', href: '/sites/foo' },
|
|
92
|
-
startAfter: 'sites/foo',
|
|
93
|
-
});
|
|
94
|
-
expect(crumbs).toEqual([
|
|
95
|
-
{ label: 'Foo', href: '/sites/foo' },
|
|
96
|
-
{ label: 'Content', href: '/sites/foo/content' },
|
|
97
|
-
{ label: 'Articles', href: '/sites/foo/content/articles' },
|
|
98
|
-
]);
|
|
99
|
-
});
|
|
100
|
-
it('returns only rootCrumb when startAfter is not present in pathname', () => {
|
|
101
|
-
const crumbs = deriveCrumbsFromNav('/other/path', nav, {
|
|
102
|
-
rootCrumb: { label: 'Root', href: '/' },
|
|
103
|
-
startAfter: 'sites/foo',
|
|
104
|
-
});
|
|
105
|
-
expect(crumbs).toEqual([{ label: 'Root', href: '/' }]);
|
|
106
|
-
});
|
|
107
|
-
it('returns an empty array for an empty pathname with no rootCrumb', () => {
|
|
108
|
-
expect(deriveCrumbsFromNav('', nav)).toEqual([]);
|
|
109
|
-
});
|
|
110
|
-
it('handles a leading-slash startAfter the same as no leading slash', () => {
|
|
111
|
-
const siteNav = [
|
|
112
|
-
{ href: '/sites/foo/content', label: 'Content' },
|
|
113
|
-
];
|
|
114
|
-
const a = deriveCrumbsFromNav('/sites/foo/content', siteNav, {
|
|
115
|
-
startAfter: '/sites/foo',
|
|
116
|
-
});
|
|
117
|
-
const b = deriveCrumbsFromNav('/sites/foo/content', siteNav, {
|
|
118
|
-
startAfter: 'sites/foo',
|
|
119
|
-
});
|
|
120
|
-
expect(a).toEqual(b);
|
|
121
|
-
});
|
|
122
|
-
// Regression for #1231: multi-segment startAfter must match the full
|
|
123
|
-
// contiguous sequence in the pathname, not just the last token. Previous
|
|
124
|
-
// implementation used `segments.indexOf(lastStartSegment)` which would
|
|
125
|
-
// find the wrong offset when an earlier segment repeated the last token.
|
|
126
|
-
it('matches the full contiguous startAfter sequence even when its trailing token appears earlier in the path', () => {
|
|
127
|
-
const siteNav = [
|
|
128
|
-
{ href: '/sites/sites/content', label: 'Content' },
|
|
129
|
-
];
|
|
130
|
-
const crumbs = deriveCrumbsFromNav('/sites/sites/content', siteNav, {
|
|
131
|
-
startAfter: 'sites/sites',
|
|
132
|
-
});
|
|
133
|
-
// If the helper anchored on the first `sites`, basePath would be
|
|
134
|
-
// `/sites` and we'd emit two extra crumbs (`sites`, `content`). The
|
|
135
|
-
// correct behavior is to anchor on the second `sites` and emit only
|
|
136
|
-
// the trailing `content` crumb.
|
|
137
|
-
expect(crumbs).toEqual([
|
|
138
|
-
{ label: 'Content', href: '/sites/sites/content' },
|
|
139
|
-
]);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Harness for asserting that <ToolsDock>'s `context` prop is forwarded into
|
|
4
|
-
* the dock instance reactively — including the case where the initial value
|
|
5
|
-
* is `undefined` and is later populated (async route data), and the case
|
|
6
|
-
* where the prop changes multiple times after mount.
|
|
7
|
-
*
|
|
8
|
-
* Owns a `$state` ref for the current context so that the test can mutate it
|
|
9
|
-
* post-mount via the `setContextProp` callback exposed via `onReady`.
|
|
10
|
-
*/
|
|
11
|
-
import {
|
|
12
|
-
defineToolsDock,
|
|
13
|
-
type ToolsDockInstance,
|
|
14
|
-
} from '../tools-dock/define-tools-dock.svelte.js';
|
|
15
|
-
import ToolsDock from '../tools-dock/ToolsDock.svelte';
|
|
16
|
-
import type { ToolsDockContext } from '../types.js';
|
|
17
|
-
|
|
18
|
-
interface Props {
|
|
19
|
-
onReady: (api: {
|
|
20
|
-
dock: ToolsDockInstance;
|
|
21
|
-
setContextProp: (next: ToolsDockContext | null | undefined) => void;
|
|
22
|
-
}) => void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const props: Props = $props();
|
|
26
|
-
|
|
27
|
-
const NoopBody = (() => null) as never;
|
|
28
|
-
|
|
29
|
-
const dock = defineToolsDock({
|
|
30
|
-
tools: [{ id: 'chat', label: 'Chat', component: NoopBody }],
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
let currentContext = $state<ToolsDockContext | null | undefined>(undefined);
|
|
34
|
-
|
|
35
|
-
// This harness intentionally snapshots the callback during component setup.
|
|
36
|
-
// svelte-ignore state_referenced_locally
|
|
37
|
-
props.onReady({
|
|
38
|
-
dock,
|
|
39
|
-
setContextProp: (next) => {
|
|
40
|
-
currentContext = next;
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<ToolsDock {dock} context={currentContext} />
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Harness for asserting that <ToolsDock>'s `context` prop is forwarded into
|
|
3
|
-
* the dock instance reactively — including the case where the initial value
|
|
4
|
-
* is `undefined` and is later populated (async route data), and the case
|
|
5
|
-
* where the prop changes multiple times after mount.
|
|
6
|
-
*
|
|
7
|
-
* Owns a `$state` ref for the current context so that the test can mutate it
|
|
8
|
-
* post-mount via the `setContextProp` callback exposed via `onReady`.
|
|
9
|
-
*/
|
|
10
|
-
import { type ToolsDockInstance } from '../tools-dock/define-tools-dock.svelte.js';
|
|
11
|
-
import type { ToolsDockContext } from '../types.js';
|
|
12
|
-
interface Props {
|
|
13
|
-
onReady: (api: {
|
|
14
|
-
dock: ToolsDockInstance;
|
|
15
|
-
setContextProp: (next: ToolsDockContext | null | undefined) => void;
|
|
16
|
-
}) => void;
|
|
17
|
-
}
|
|
18
|
-
declare const ContextForwardingHarness: import("svelte").Component<Props, {}, "">;
|
|
19
|
-
type ContextForwardingHarness = ReturnType<typeof ContextForwardingHarness>;
|
|
20
|
-
export default ContextForwardingHarness;
|
|
21
|
-
//# sourceMappingURL=context-forwarding-harness.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-forwarding-harness.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/__tests__/context-forwarding-harness.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,UAAU,KAAK;IACb,OAAO,EAAE,CAAC,GAAG,EAAE;QACb,IAAI,EAAE,iBAAiB,CAAC;QACxB,cAAc,EAAE,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;KACrE,KAAK,IAAI,CAAC;CACZ;AAgCD,QAAA,MAAM,wBAAwB,2CAAwC,CAAC;AACvE,KAAK,wBAAwB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC5E,eAAe,wBAAwB,CAAC"}
|