Added unit tests for state updates