Update tests to mock isWriting