Making unit test more tolerant of browser history update delays in phantomjs