This is a little confusing. On entry to the function, `wasInvalid` should be set based on whether the document was invalid before these edits execute. During the function, we update it so that future calls to `_updateDOM` during the function are properly set up. However, any given call to `doOperationAndExpect()` either expects all of the typing/deletions to be invalid, or should expect all of them to be valid. So this flag really should only change the first time through.