fix(storybook): stub AccessStore in the shell story (fixes storybook-a11y red)
CI / frontend (push) Successful in 1m47s
CI / storybook-a11y (push) Successful in 4m27s
CI / backend (push) Successful in 1m23s
CI / e2e (push) Successful in 2m36s
CI / codeql (csharp) (push) Failing after 2m1s
CI / codeql (javascript-typescript) (push) Failing after 1m29s
CI / api-client-drift (push) Successful in 2m8s
CI / frontend (push) Successful in 1m47s
CI / storybook-a11y (push) Successful in 4m27s
CI / backend (push) Successful in 1m23s
CI / e2e (push) Successful in 2m36s
CI / codeql (csharp) (push) Failing after 2m1s
CI / codeql (javascript-typescript) (push) Failing after 1m29s
CI / api-client-drift (push) Successful in 2m8s
The header now injects AccessStore (→ MeAdapter → ApiClient) for its admin links.
f719676 stubbed that in the site-header story but missed shell.stories.ts, which
renders the header via ShellComponent — with only provideRouter it threw NG0201
(no ApiClient provider), failing the Shell smoke-test and turning storybook-a11y
red on CI (deterministic, not the local worker-contention timeouts). Stub
AccessStore there too (can() → false, no admin links).
Verified: full test-storybook suite single-worker now 60 suites / 170 tests green.
Lesson: when a shared component gains a service dep, every story that renders it —
directly OR via a parent template — needs the provider.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+1455
-1455
File diff suppressed because one or more lines are too long
@@ -1,12 +1,19 @@
|
|||||||
import type { Meta, StoryObj } from '@storybook/angular';
|
import type { Meta, StoryObj } from '@storybook/angular';
|
||||||
import { applicationConfig } from '@storybook/angular';
|
import { applicationConfig } from '@storybook/angular';
|
||||||
import { provideRouter } from '@angular/router';
|
import { provideRouter } from '@angular/router';
|
||||||
|
import { AccessStore } from '@shared/application/access.store';
|
||||||
import { ShellComponent } from './shell.component';
|
import { ShellComponent } from './shell.component';
|
||||||
|
|
||||||
const meta: Meta<ShellComponent> = {
|
const meta: Meta<ShellComponent> = {
|
||||||
title: 'Design System/Templates/Shell',
|
title: 'Design System/Templates/Shell',
|
||||||
component: ShellComponent,
|
component: ShellComponent,
|
||||||
decorators: [applicationConfig({ providers: [provideRouter([])] })],
|
// The persistent header injects AccessStore (for its capability-gated admin links);
|
||||||
|
// stub it so the story needs no HTTP/ApiClient. `can` false → no admin links.
|
||||||
|
decorators: [
|
||||||
|
applicationConfig({
|
||||||
|
providers: [provideRouter([]), { provide: AccessStore, useValue: { can: () => false } }],
|
||||||
|
}),
|
||||||
|
],
|
||||||
};
|
};
|
||||||
export default meta;
|
export default meta;
|
||||||
type Story = StoryObj<ShellComponent>;
|
type Story = StoryObj<ShellComponent>;
|
||||||
|
|||||||
Reference in New Issue
Block a user