Add tests for documents and collections