docstr: Test if the component ranks documents correctly.
docstr_tok: ["Test","if","the","component","ranks","documents","correctly","."]
code: def test_run(self, meta_field_values, expected_first_value):
      """
      Test if the component ranks documents correctly.
      """
      ranker = MetaFieldRanker(meta_field="rating")
      docs_before = [
          Document(content="abc", meta={"rating": value})
          for value in meta_field_values
      ]
  
      output = ranker.run(documents=docs_before)
      docs_after = output["documents"]
  
      assert len(docs_after) == 3
      assert docs_after[0].meta["rating"] == expected_first_value
  
      sorted_scores = sorted(
          [doc.meta["rating"] for doc in docs_after], reverse=True
      )
      assert [doc.meta["rating"] for doc in docs_after] == sorted_scores
  
imports: import pytest
  import logging
  from haystack import Document
  from haystack.components.rankers.meta_field import MetaFieldRanker
label_desc: Use image node_id 3 for calling the TestMetaFieldRanker obj's underlying member method code with example usage: obj.test_run(meta_field_values, expected_first_value) without return types