code: def test_empty_text_input_behaves_correctly(app: Page):
      """Test that st.text_input behaves correctly when empty."""
      # Should return None as value:
      expect(app.get_by_test_id("stMarkdown").nth(3)).to_have_text(
          "value 4: None", use_inner_text=True
      )
  
      # Enter value in the empty widget:
      empty_text_input = app.get_by_test_id("stTextInput").nth(3)
      empty_text_input_field = empty_text_input.locator("input").first
      empty_text_input_field.fill("hello world")
      empty_text_input_field.press("Enter")
  
      expect(app.get_by_test_id("stMarkdown").nth(3)).to_have_text(
          "value 4: hello world", use_inner_text=True
      )
  
      # Press escape to clear value:
      empty_text_input_field.focus()
      empty_text_input_field.clear()
      empty_text_input_field.press("Enter")
  
      # Should be set to empty string (we don't clear to None for text input):
      expect(app.get_by_test_id("stMarkdown").nth(3)).to_have_text(
          "value 4: ", use_inner_text=True
      )
  
file_path: streamlit/e2e_playwright/st_text_input_test.py
imports: from playwright.sync_api import Page, expect
  from e2e_playwright.conftest import ImageCompareFunction
label_desc: Use image node_id 8 for calling a global function with example usage: test_empty_text_input_behaves_correctly(app) without return types