fix reset state

This commit is contained in:
larssand
2026-07-06 17:05:27 +02:00
parent 649c29a8c2
commit da540f81ae
4 changed files with 69 additions and 0 deletions

View File

@@ -1,7 +1,9 @@
import json
import inspect
import unittest
from unittest.mock import patch
import fgai.dashboard as dashboard
from fgai.dashboard import HTML, _ollama_models
@@ -62,6 +64,11 @@ class DashboardTests(unittest.TestCase):
self.assertIn('id="clearAllIncidents"', HTML)
self.assertIn("/api/incidents/clear", HTML)
def test_dashboard_exposes_review_state_reset_endpoints(self):
source = inspect.getsource(dashboard)
self.assertIn("/api/feedback/clear", source)
self.assertIn("/api/review-state/clear", source)
def test_dashboard_does_not_clear_streams_when_picker_is_unloaded(self):
self.assertIn("const streamValues = Object.values(window.streamSelection || {})", HTML)
self.assertIn("if (streamValues.length)", HTML)