Registratie: answer-driven required document uploads
Categories stay server-owned (ADR-0001); the FE sends its answers to /uploads/categories and re-fetches reactively when they change: - Diplomabewijs required only for a handmatig diploma (DUO is verified digitally; nothing required before a diploma is chosen). - Bewijs Nederlandse taalvaardigheid required only when the applicant answers "ja" to the nl-taalvaardigheid (B2) policy question. CategoriesFor(wizardId, diplomaHerkomst, taalvaardigheid) decides; Find uses the maximal set so uploads still validate. CategoriesLoaded drops orphaned uploads when a category disappears. Also: show the foreground-only upload banner only when there is at least one category. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,15 @@ describe('CategoriesLoaded', () => {
|
||||
const s = reduceUpload({ ...initialUpload, categoriesError: 'boom' }, { type: 'CategoriesLoaded', categories: [] });
|
||||
expect(s.categoriesError).toBeUndefined();
|
||||
});
|
||||
|
||||
it('drops uploads + channel choices for categories that disappear', () => {
|
||||
const s0 = select(stateWith([cat({ categoryId: 'diploma' }), cat({ categoryId: 'id' })], { deliveryChannel: { id: 'post' } }), 'diploma', 'u1');
|
||||
expect(get(s0, 'u1')).toBeDefined();
|
||||
// Reload with the diploma category gone (e.g. DUO chosen).
|
||||
const s1 = reduceUpload(s0, { type: 'CategoriesLoaded', categories: [cat({ categoryId: 'id' })] });
|
||||
expect(get(s1, 'u1')).toBeUndefined();
|
||||
expect(s1.deliveryChannel).toEqual({ id: 'post' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('CategoriesLoadFailed / BackgroundSyncAvailability', () => {
|
||||
|
||||
Reference in New Issue
Block a user