Adjust test case for toggling checkbox
Fix incorrect intermediate status after toggling a checkbox

The old mechanism of updating all checkboxes is buggy, so I
refactor the code here to make it reasonable.