code: def test_to_dict(self):
      component = SerperDevWebSearch(
          api_key="test_key",
          top_k=10,
          allowed_domains=["test.com"],
          search_params={"param": "test"},
      )
      data = component.to_dict()
      assert data == {
          "type": "haystack.components.websearch.serper_dev.SerperDevWebSearch",
          "init_parameters": {
              "top_k": 10,
              "allowed_domains": ["test.com"],
              "search_params": {"param": "test"},
          },
      }
  
file_path: haystack/test/components/websearch/test_serperdev.py
imports: import os
  from unittest.mock import Mock, patch
  import pytest
  from requests import Timeout, RequestException, HTTPError
  from haystack import Document
  from haystack.components.websearch.serper_dev import SerperDevWebSearch, SerperDevError
label_desc: Use image node_id 2 for calling the TestSerperDevSearchAPI obj's underlying member method code with example usage: obj.test_to_dict() without return types