Small refactor to DocumentTest.js