docstr: Router accepts a list of routes with mandatory and optional fields but not if some new field is added
docstr_tok: ["Router","accepts","a","list","of","routes","with","mandatory","and","optional","fields","but","not","if","some","new","field","is","added"]
code: def test_mandatory_and_optional_fields_with_extra_fields(self):
      """
      Router accepts a list of routes with mandatory and optional fields but not if some new field is added
      """
  
      routes = [
          {
              "condition": "{{streams|length < 2}}",
              "output": "{{query}}",
              "output_type": str,
              "output_name": "test",
              "bla": "bla",
          },
          {
              "condition": "{{streams|length < 2}}",
              "output": "{{query}}",
              "output_type": str,
          },
      ]
  
      with pytest.raises(ValueError):
          ConditionalRouter(routes)
  
imports: import copy
  from typing import List
  from unittest import mock
  import pytest
  from haystack.components.routers import ConditionalRouter
  from haystack.components.routers.conditional_router import NoRouteSelectedException
  from haystack.dataclasses import ChatMessage
label_desc: Use image node_id 6 for calling the TestRouter obj's underlying member method code with example usage: obj.test_mandatory_and_optional_fields_with_extra_fields() without return types