• Stefy Lanza (nextime / spora )'s avatar
    Fix studio and market-reference route tests for current implementation · 01a2551d
    Stefy Lanza (nextime / spora ) authored
    These tests lagged behind two refactors:
    
    - build_studio_catalog is now an async coroutine. Update the studio tests to
      await it: direct-call tests wrap it in asyncio.run(), and the HTTP tests'
      monkeypatched stubs are now async (the route handler awaits the result, so a
      sync stub returning a dict raised "object dict can't be used in 'await'
      expression").
    - The providers page bootstraps provider data from a dedicated JSON <script>
      element (providers_bootstrap_json, escaped by the route's _json_parse_bootstrap
      helper) parsed via JSON.parse, instead of an inline `let providersData = {...}`
      literal. Update the admin bootstrap test to feed providers_bootstrap_json and
      assert on the <script id="providers-bootstrap"> element (escaping + double
      JSON decode) and the JSON.parse usage.
    - Add the missing record_dashboard_event method to MarketReferenceImportDbStub,
      which the market import route now calls.
    
    tests/routes now passes 86/86 (was 18 failing).
    Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
    01a2551d
test_dashboard_studio.py 23.2 KB