MCPcopy
hub / github.com/streamlit/streamlit / test_date_input_rendering

Function test_date_input_rendering

e2e_playwright/st_date_input_test.py:40–109  ·  view source on GitHub ↗

Test that st.date_input renders correctly via screenshots matching.

(themed_app: Page, assert_snapshot: ImageCompareFunction)

Source from the content-addressed store, hash-verified

38
39
40def test_date_input_rendering(themed_app: Page, assert_snapshot: ImageCompareFunction):
41 """Test that st.date_input renders correctly via screenshots matching."""
42 expect(themed_app.get_by_test_id("stDateInput")).to_have_count(NUM_DATE_INPUTS)
43
44 assert_snapshot(
45 get_date_input(themed_app, "Single date"), name="st_date_input-single_date"
46 )
47 assert_snapshot(
48 get_date_input(themed_app, "Single datetime"),
49 name="st_date_input-single_datetime",
50 )
51 assert_snapshot(
52 get_date_input(themed_app, "Range, no date"),
53 name="st_date_input-range_no_date",
54 )
55 assert_snapshot(
56 get_date_input(themed_app, "Range, one date"),
57 name="st_date_input-range_one_date",
58 )
59 assert_snapshot(
60 get_date_input(themed_app, "Range, two dates"),
61 name="st_date_input-range_two_dates",
62 )
63 assert_snapshot(
64 get_date_input(themed_app, "Disabled, no date"),
65 name="st_date_input-disabled_no_date",
66 )
67 assert_snapshot(
68 get_element_by_key(themed_app, "date_input_7"),
69 name="st_date_input-label_hidden",
70 )
71 assert_snapshot(
72 get_element_by_key(themed_app, "date_input_8"),
73 name="st_date_input-label_collapsed",
74 )
75 assert_snapshot(
76 get_date_input(themed_app, "Single date with format"),
77 name="st_date_input-single_date_format",
78 )
79 assert_snapshot(
80 get_date_input(themed_app, "Range, two dates with format"),
81 name="st_date_input-range_two_dates_format",
82 )
83 assert_snapshot(
84 get_date_input(themed_app, "Range, no date with format"),
85 name="st_date_input-range_no_date_format",
86 )
87 assert_snapshot(
88 get_element_by_key(themed_app, "date_input_12"),
89 name="st_date_input-single_date_callback",
90 )
91 assert_snapshot(
92 get_date_input(themed_app, "Empty value"), name="st_date_input-empty_value"
93 )
94 assert_snapshot(
95 get_date_input(themed_app, "Value from state"),
96 name="st_date_input-value_from_state",
97 )

Callers

nothing calls this directly

Calls 4

get_date_inputFunction · 0.90
get_element_by_keyFunction · 0.90
assert_snapshotFunction · 0.85
get_by_test_idMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…