Added unit tests for document update function