add unit tests for refresh and dom cleanup