Three dashboard-section stories used a fourth title segment (`Domein/Registratie/Dashboard/<Name>`) that the sidebar rule does not have. Drop the `Dashboard/` segment so all story titles follow the one rule from CLAUDE.md decision 5. Add the two missing stories for sections that have more than one visual state: `wat-moet-ik-regelen` (4 states) and `wat-wilt-u-doen` (2 states, the first story in the new `Domein/Overzicht/` bucket). `beheer-links` gets no story — it has one visual state and its other branch renders nothing. The `MetTaken` story disables the a11y addon with the same reason and WP-11 reference already used on `task-list.stories.ts` and `choice-list.stories.ts`: `app-choice-link`'s host sits between the keuzelijst `<ul>` and its `<li>`, a pre-existing structural gap this ticket does not fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
110 lines
3.2 KiB
TypeScript
110 lines
3.2 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/angular';
|
|
import { applicationConfig } from '@storybook/angular';
|
|
import { WatMoetIkRegelenSection } from './wat-moet-ik-regelen.section';
|
|
import { BigProfileStore } from '@registratie/application/big-profile.store';
|
|
import { BigProfile } from '@registratie/domain/big-profile';
|
|
import { HerregistratieDecisions } from '@registratie/domain/registration';
|
|
import { RemoteData } from '@shared/application/remote-data';
|
|
import { loading, success } from '@shared/testing/remote-data';
|
|
|
|
const profile: BigProfile = {
|
|
registration: {
|
|
bigNummer: '19012345601',
|
|
naam: 'Dr. A. (Anna) de Vries',
|
|
beroep: 'Arts',
|
|
registratiedatum: '2012-09-01',
|
|
geboortedatum: '1985-03-14',
|
|
status: { tag: 'Geregistreerd', herregistratieDatum: '2027-09-01' },
|
|
},
|
|
person: {
|
|
naam: 'Dr. A. (Anna) de Vries',
|
|
geboortedatum: '1985-03-14',
|
|
adres: { straat: 'Rijksweg 1', postcode: '2514 EA', woonplaats: 'Den Haag' },
|
|
},
|
|
};
|
|
|
|
/** Minimal store stand-in — only the members the section's template and class read. */
|
|
function storeStub(
|
|
profileRd: RemoteData<Error | undefined, BigProfile>,
|
|
decisionsRd: RemoteData<Error | undefined, HerregistratieDecisions>,
|
|
pendingHerregistratie: boolean,
|
|
) {
|
|
return {
|
|
profile: () => profileRd,
|
|
decisions: () => decisionsRd,
|
|
pendingHerregistratie: () => pendingHerregistratie,
|
|
reloadProfile: () => {},
|
|
};
|
|
}
|
|
|
|
const meta: Meta<WatMoetIkRegelenSection> = {
|
|
title: 'Domein/Registratie/Wat Moet Ik Regelen',
|
|
component: WatMoetIkRegelenSection,
|
|
};
|
|
export default meta;
|
|
type Story = StoryObj<WatMoetIkRegelenSection>;
|
|
|
|
export const Loading: Story = {
|
|
decorators: [
|
|
applicationConfig({
|
|
providers: [{ provide: BigProfileStore, useValue: storeStub(loading(), loading(), false) }],
|
|
}),
|
|
],
|
|
};
|
|
export const MetTaken: Story = {
|
|
decorators: [
|
|
applicationConfig({
|
|
providers: [
|
|
{
|
|
provide: BigProfileStore,
|
|
useValue: storeStub(
|
|
success(profile),
|
|
success({ eligibleForHerregistratie: true }),
|
|
false,
|
|
),
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
parameters: {
|
|
// Structural: app-choice-link's host sits between the keuzelijst <ul> and its <li>
|
|
// — axe's list/listitem rule needs them adjacent regardless of `display:contents`.
|
|
// Same pre-existing gap as task-list.stories.ts and choice-list.stories.ts. WP-11
|
|
// (CIBG markup fidelity) reworks this markup; see
|
|
// docs/project/backlog/WP-11-markup-fidelity.md.
|
|
a11y: { disable: true },
|
|
},
|
|
};
|
|
export const NietsOpenstaand: Story = {
|
|
decorators: [
|
|
applicationConfig({
|
|
providers: [
|
|
{
|
|
provide: BigProfileStore,
|
|
useValue: storeStub(
|
|
success(profile),
|
|
success({ eligibleForHerregistratie: false }),
|
|
false,
|
|
),
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
};
|
|
export const InBehandeling: Story = {
|
|
decorators: [
|
|
applicationConfig({
|
|
providers: [
|
|
{
|
|
provide: BigProfileStore,
|
|
useValue: storeStub(
|
|
success(profile),
|
|
success({ eligibleForHerregistratie: false }),
|
|
true,
|
|
),
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
};
|