code: def test_plot_components(expected_component_names):
      """Tests "plot_components" of UnivariateForecast class"""
      X = pd.DataFrame(
          {
              cst.TIME_COL: pd.date_range(
                  "2018-01-01", periods=10, freq="D"
              ),
              cst.VALUE_COL: np.arange(1, 11),
          }
      )
      coverage = 0.95
  
      # Test Silverkite
      trained_model = Pipeline(
          [("estimator", SilverkiteEstimator(coverage=coverage))]
      )
      with pytest.warns(Warning) as record:
          trained_model.fit(X, X[cst.VALUE_COL])
          assert "Zero degrees of freedom" in record[0].message.args[0]
          assert (
              "No slice had sufficient sample size"
              in record[1].message.args[0]
          )
      forecast = get_forecast(X, trained_model)
  
      # Tests plot_components
      title = "Custom component plot"
      fig = forecast.plot_components(title=title)
      expected_rows = 9
      assert len(fig.data) == expected_rows  # includes changepoints
      assert all(
          [
              fig.data[i].name in expected_component_names
              for i in range(expected_rows)
          ]
      )
      assert fig.layout.xaxis.title["text"] == "Date"
      assert fig.layout.title["text"] == title
      assert fig.layout.title["x"] == 0.5
  
imports: import datetime
  import math
  import sys
  from functools import partial
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from pandas.testing import assert_series_equal
  from sklearn.pipeline import Pipeline
  from greykite.common import constants
  from greykite.common.evaluation import ElementwiseEvaluationMetricEnum
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import gen_sliced_df
  from greykite.framework.input.univariate_time_series import UnivariateTimeSeries
  from greykite.framework.output.univariate_forecast import UnivariateForecast
  from greykite.framework.pipeline.utils import get_forecast
  from greykite.sklearn.estimator.prophet_estimator import ProphetEstimator
  from greykite.sklearn.estimator.silverkite_estimator import SilverkiteEstimator
  from greykite.sklearn.estimator.testing_utils import params_component_breakdowns
label_desc: Use image node_id 18 for calling a global function with example usage: test_plot_components(expected_component_names) without return types