Laura10101 / contractor-tax-calculator

0 stars 2 forks source link

Success view when saving multiple choice options or rule tiers fails to handle app state correctly #209

Closed Laura10101 closed 10 months ago

Laura10101 commented 10 months ago

● Status views › Success views › Successfully saving › Multiple choice options › should display a success message, move the parent state to the app state, and refresh the appropriate display components Expected: "edit" Received: "create" 501 | 502 | // Check app state

503 | expect(app.dialogState.mode).toBe(dialogStates.modes.edit);

● Status views › Success views › Successfully saving › Rule tiers › should display a success message, clear the app state, and refresh the appropriate display components Expected: "edit" Received: "create" 571 | 572 | // Check app state

573 | expect(app.dialogState.mode).toBe(dialogStates.modes.edit);

Laura10101 commented 10 months ago

The success views were not managing the app state. Added code to move the parent state to the app state once the save is successful. This is necessary because rule tiers and multiple choice options can only be updated while accessing the parent question or rule respectively.