add test for replaceing whole document by "add"