adding tests for state machine