adds tests for history middleware