test_the_file_layer_is_its_own_budgeted_script

Tests › tests/test_wiki_web.py

passed Passed in the packaged run.

What this test is for

Why it exists

web.js is at its 16 KB budget, so the file layer is a second script with its own budget (the clew-views.js precedent), loaded BEFORE web.js; web.js calls it when zoomed in.

Given

  1. js = (Path(clew.wiki.__file__).parent / "themes/clew/static/web-files.js").read_text()
→

When

  1. page = web_html({"nodes": [], "blocks": [], "links": []})
→

Then

  1. ✓ js contains "function webFiles("
  2. ✓ len(js.encode()) is at most 8192
  3. ✓ WEB_JS contains "window.webFiles"
  4. ✓ page.index("web-files.js") is less than page.index("_static/web.js")

tests/test_wiki_web.py:309 · its file's page

What it checks (3)

  1. assert "function webFiles(" in js and len(js.encode()) <= 8192 not attributed
  2. assert "window.webFiles" in WEB_JS not attributed
  3. assert page.index("web-files.js") < page.index("_static/web.js") observes web_html via page

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_the_file_layer_is_its_own_budgeted_script→web_html

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

test_the_file_layer_is_its_own_budgeted_script · 3 checksweb_htmlREQ-DDB-WIKI-021 · measured
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.