Skip to main content

Task 6: KPI Template Weightage Validation (Total Must Equal 100)

Test Cases

IDScenarioExpected ResultStatus
T6-01Create template with items where total weight is exactly 100Save succeeds
T6-02Edit template and change items to total not equal 100Save blocked with validation error
T6-03Edit template and keep valid total after add/remove/reorderSave succeeds and order persists
T6-04Try saving with missing/empty item weightSave blocked with validation error
T6-05Use item sync to clear all items from a templateExisting items are removed successfully
T6-06Attempt sync using item id from a different templateReturns 422 and no cross-template mutation
T6-07Publish cycle where one matched template has invalid total weightEvaluation still created as missing_template=true for affected employees
T6-08Regression check: valid template still publishes normal evaluation itemsEvaluation items are snapped correctly with expected weights and sort order
T6-09Manager/Employee tries KPI template item sync endpointReturns 403
T6-10UI total weight indicator while editing itemsShows non-100 total in error style and blocks save until total becomes 100

Demo Walkthrough

  1. Create template with 3 items totaling 100 → Show success
  2. Edit template and change weights to total 90 → Show validation blocks save
  3. Show UI weight indicator → Real-time total calculation with red/green styling
  4. Login as Employee → Try template endpoint → Show 403