docstr: Test st.spinner in st.chat_message resets to empty container block.
docstr_tok: ["Test","st.spinner","in","st.chat_message","resets","to","empty","container","block","."]
code: def test_spinner_within_chat_message(self):
      """Test st.spinner in st.chat_message resets to empty container block."""
      import streamlit as st
  
      with st.chat_message("user"):
          with spinner("some text"):
              # Without the timeout, the spinner is sometimes not available
              time.sleep(0.7)
              el = self.get_delta_from_queue().new_element
              self.assertEqual(el.spinner.text, "some text")
              self.assertFalse(el.spinner.cache)
      # Check that the element gets reset to an empty container block:
      last_delta = self.get_delta_from_queue()
      self.assertTrue(last_delta.HasField("add_block"))
      # The block should have `allow_empty` set to false,
      # which means that it will be ignored on the frontend in case
      # it the container is empty. This is the desired behavior
      # for spinner
      self.assertFalse(last_delta.add_block.allow_empty)
  
file_path: streamlit/lib/tests/streamlit/spinner_test.py
imports: import time
  from streamlit.elements.spinner import spinner
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
label_desc: Use image node_id 2 for calling the SpinnerTest obj's underlying member method code with example usage: obj.test_spinner_within_chat_message() without return types