code: def test_plot_components(daily_data, params):
      """Test plot_components"""
      train_df = daily_data["train_df"]
      test_df = daily_data["test_df"]
  
      model = ProphetEstimator()
      model.fit(train_df)
      assert model.forecast is None
  
      model.predict(test_df)
      forecast = model.forecast
      expected_forecast_cols = {
          "ds",
          "yhat",
          "yhat_lower",
          "yhat_upper",
          "trend",
          "trend_lower",
          "trend_upper",
          "weekly",
          "weekly_lower",
          "weekly_upper",
      }
      assert expected_forecast_cols.issubset(list(forecast.columns))
  
      fig = model.plot_components(uncertainty=True, plot_cap=False)
      assert fig
  
      direct_model = model.model
      direct_fig = direct_model.plot_components(
          fcst=forecast, uncertainty=True, plot_cap=False
      )
      assert direct_fig
  
      # Tests plot_components warnings
      model = ProphetEstimator()
      with pytest.raises(
          NotFittedError, match="The fit method has not been run yet."
      ):
          model.plot_components()
  
      with pytest.raises(
          RuntimeError, match="The predict method has not been run yet."
      ):
          model.fit(train_df)
          model.plot_components()
  
imports: import sys
  import numpy
  import pandas
  import pytest
  from sklearn.exceptions import NotFittedError
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_squared_error
  from testfixtures import LogCapture
  from greykite.common.constants import LOGGER_NAME
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.evaluation import calc_pred_err
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.testing_utils import generate_df_with_reg_for_tests
  from greykite.sklearn.estimator.prophet_estimator import ProphetEstimator
label_desc: Use image node_id 19 for calling a global function with example usage: test_plot_components(daily_data, params) without return types