added unit tests for editing documents