add a test for doc.invalid?