code: def test_default_component_to_dict():
      MyComponent = factory.component_class("MyComponent")
      comp = MyComponent()
      res = default_to_dict(comp)
      assert res == {
          "type": "haystack.testing.factory.MyComponent",
          "init_parameters": {},
      }
  
file_path: haystack/test/core/test_serialization.py
imports: import sys
  from unittest.mock import Mock
  import pytest
  from haystack.core.pipeline import Pipeline
  from haystack.core.component import component
  from haystack.core.errors import DeserializationError
  from haystack.testing import factory
  from haystack.core.serialization import default_to_dict, default_from_dict
label_desc: Use image node_id 1 for calling a global function with example usage: test_default_component_to_dict() without return types