Block repeated on while auto-off is active
This commit is contained in:
@@ -37,6 +37,9 @@ class UiRenderTest(unittest.TestCase):
|
||||
self.assertIn('data-requires-ack="true"', html)
|
||||
self.assertIn("Example camera", html)
|
||||
self.assertIn("v=42", html)
|
||||
self.assertIn('class="snapshot-refresh"', html)
|
||||
self.assertIn('title="Refresh snapshot"', html)
|
||||
self.assertIn('disabled title="Already active until automatic turn-off"', html)
|
||||
|
||||
def test_controls_from_same_camera_share_one_card(self):
|
||||
actions = [
|
||||
@@ -92,6 +95,25 @@ class UiRenderTest(unittest.TestCase):
|
||||
"https://frigate.example.test/#example",
|
||||
)
|
||||
|
||||
def test_on_button_is_available_when_no_auto_off_timer_runs(self):
|
||||
action = DummyAction()
|
||||
action.auto_off_at = None
|
||||
|
||||
html = render_page([action], "en")
|
||||
|
||||
self.assertIn('class="cmd cmd-on"', html)
|
||||
self.assertNotIn('Already active until automatic turn-off', html)
|
||||
|
||||
def test_camera_card_uses_friendly_display_name(self):
|
||||
action = DummyAction()
|
||||
action.cfg["camera_name"] = "camera_key"
|
||||
action.cfg["camera_display_name"] = "Camera Friendly"
|
||||
|
||||
html = render_page([action], "en")
|
||||
|
||||
self.assertIn("<h2>Camera Friendly</h2>", html)
|
||||
self.assertNotIn("<h2>camera_key</h2>", html)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user