@@ -29,26 +29,30 @@ def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
2929 expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
3030 expect (chat .loc_latest_message ).to_have_attribute ("type" , "dynamic" )
3131
32-
3332 # Send a status message that updates the original message
3433 content .set ("Using model <code>phi4</code>" )
3534 submit .click ()
3635 chat .expect_latest_message ("Using model phi4" )
3736 expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
3837 expect (chat .loc_latest_message ).to_have_attribute ("type" , "dynamic" )
3938
40-
4139 # 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+ )
4343 content .set (html_message )
4444 status_type .set ("static" )
4545 submit .click ()
4646 chat .expect_latest_message ("Lost connection with provider." )
4747 expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
4848 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+ )
5052 # 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+ )
5256
5357 # Now another message as raw text
5458 content .set ("Using model <code>deepseek-r1</code>" )
@@ -66,7 +70,6 @@ def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
6670 expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
6771 expect (chat .loc_latest_message ).to_have_attribute ("type" , "dynamic" )
6872
69-
7073 chat .set_user_input ("Hello" )
7174 chat .send_user_input ()
7275 chat .expect_latest_message ("You said: Hello" )
@@ -75,4 +78,6 @@ def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None:
7578 chat .expect_latest_message ("Disconnecting. Goodbye!" )
7679 expect (chat .loc_latest_message ).to_have_attribute ("content_type" , "html" )
7780 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