Revert "Submit GUI commands without page navigation"
This reverts commit 0da5377ff2.
This commit is contained in:
+1
-19
@@ -103,8 +103,7 @@ class UiRenderTest(unittest.TestCase):
|
||||
html = render_page([action], "en")
|
||||
|
||||
self.assertIn('class="cmd cmd-on"', html)
|
||||
self.assertNotIn('class="cmd cmd-on" type="submit" disabled', html)
|
||||
self.assertIn('data-disabled-label="Already active until automatic turn-off"', html)
|
||||
self.assertNotIn('Already active until automatic turn-off', html)
|
||||
|
||||
def test_camera_card_uses_friendly_display_name(self):
|
||||
action = DummyAction()
|
||||
@@ -122,23 +121,6 @@ class UiRenderTest(unittest.TestCase):
|
||||
self.assertIn("SNAPSHOT_REFRESH_DELAY_MS = 5000", script)
|
||||
self.assertIn("window.setTimeout", script)
|
||||
|
||||
def test_command_forms_expose_ajax_status_metadata(self):
|
||||
html = render_page([DummyAction()], "en")
|
||||
|
||||
self.assertIn('class="command-form"', html)
|
||||
self.assertIn('data-working-label="Sending command..."', html)
|
||||
self.assertIn('data-success-label="Command sent."', html)
|
||||
self.assertIn('data-action-status', html)
|
||||
self.assertIn('data-state-chip', html)
|
||||
|
||||
def test_command_submit_uses_fetch_without_page_navigation(self):
|
||||
script = Path("frigate_camera_control_bridge/static/app.js").read_text(encoding="utf-8")
|
||||
|
||||
self.assertIn("handleCommandSubmit(form, event)", script)
|
||||
self.assertIn('form.classList.contains("command-form")', script)
|
||||
self.assertIn('headers: { Accept: "application/json" }', script)
|
||||
self.assertIn("event.preventDefault()", script)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user