code: def test_empty_date_input_behaves_correctly(
      app: Page, assert_snapshot: ImageCompareFunction
  ):
      """Test that st.date_input behaves correctly when empty."""
      # Enter 10 in the first empty input:
      empty_number_input = app.locator(".stDateInput input").nth(12)
      empty_number_input.type("1970/01/02")
      empty_number_input.press("Enter")
  
      expect(app.get_by_test_id("stMarkdown").nth(13)).to_have_text(
          "Value 13: 1970-01-02", use_inner_text=True
      )
  
      # Click outside to remove focus:
      app.get_by_test_id("stMarkdown").nth(13).click()
  
      # Screenshot match clearable input:
      assert_snapshot(
          app.get_by_test_id("stDateInput").nth(12),
          name="st_date_input-clearable_input",
      )
  
      # Press escape to clear value:
      empty_number_input = app.locator(".stDateInput input").nth(12)
      empty_number_input.focus()
      empty_number_input.press("Escape")
      # Click outside to enter value:
      app.get_by_test_id("stMarkdown").nth(13).click()
  
      # Should be empty again:
      expect(app.get_by_test_id("stMarkdown").nth(13)).to_have_text(
          "Value 13: None", use_inner_text=True
      )
  
file_path: streamlit/e2e_playwright/st_date_input_test.py
imports: from playwright.sync_api import Page, expect
  from e2e_playwright.conftest import ImageCompareFunction
label_desc: Use image node_id 5 for calling a global function with example usage: test_empty_date_input_behaves_correctly(app, assert_snapshot) without return types