@@ -29,26 +29,30 @@ def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
29
29
expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
30
30
expect (chat .loc_latest_message ).to_have_attribute ("type" , "dynamic" )
31
31
32
-
33
32
# Send a status message that updates the original message
34
33
content .set ("Using model <code>phi4</code>" )
35
34
submit .click ()
36
35
chat .expect_latest_message ("Using model phi4" )
37
36
expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
38
37
expect (chat .loc_latest_message ).to_have_attribute ("type" , "dynamic" )
39
38
40
-
41
39
# Send a new status message that is static (doesn't overwrite previous message)
42
- html_message = '<div class="alert alert-warning">Lost connection with provider.</div>'
40
+ html_message = (
41
+ '<div class="alert alert-warning">Lost connection with provider.</div>'
42
+ )
43
43
content .set (html_message )
44
44
status_type .set ("static" )
45
45
submit .click ()
46
46
chat .expect_latest_message ("Lost connection with provider." )
47
47
expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
48
48
expect (chat .loc_latest_message ).to_have_attribute ("type" , "static" )
49
- expect (chat .loc_latest_message .locator ("> :first-child" )).to_have_class ("alert alert-warning" )
49
+ expect (chat .loc_latest_message .locator ("> :first-child" )).to_have_class (
50
+ "alert alert-warning"
51
+ )
50
52
# previous status message is still there
51
- expect (chat .loc_messages .locator ("> :nth-last-child(2)" )).to_have_text ("Using model phi4" )
53
+ expect (chat .loc_messages .locator ("> :nth-last-child(2)" )).to_have_text (
54
+ "Using model phi4"
55
+ )
52
56
53
57
# Now another message as raw text
54
58
content .set ("Using model <code>deepseek-r1</code>" )
@@ -66,7 +70,6 @@ def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
66
70
expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
67
71
expect (chat .loc_latest_message ).to_have_attribute ("type" , "dynamic" )
68
72
69
-
70
73
chat .set_user_input ("Hello" )
71
74
chat .send_user_input ()
72
75
chat .expect_latest_message ("You said: Hello" )
@@ -75,4 +78,6 @@ def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
75
78
chat .expect_latest_message ("Disconnecting. Goodbye!" )
76
79
expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
77
80
expect (chat .loc_latest_message ).to_have_attribute ("type" , "dynamic" )
78
- expect (chat .loc_messages .locator ("> :nth-last-child(4)" )).to_have_text ("Using model deepseek-r1" )
81
+ expect (chat .loc_messages .locator ("> :nth-last-child(4)" )).to_have_text (
82
+ "Using model deepseek-r1"
83
+ )
0 commit comments