test_the_file_layer_is_its_own_budgeted_script¶
Tests › tests/test_wiki_web.py
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
js = (Path(clew.wiki.__file__).parent / "themes/clew/static/web-files.js").read_text()
When
page = web_html({"nodes": [], "blocks": [], "links": []})
Then
- ✓ js contains "function webFiles("
- ✓ len(js.encode()) is at most 8192
- ✓ WEB_JS contains "window.webFiles"
- ✓ 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)
assert "function webFiles(" in js and len(js.encode()) <= 8192not attributedassert "window.webFiles" in WEB_JSnot attributedassert page.index("web-files.js") < page.index("_static/web.js")observesweb_htmlviapage
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
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.
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-WIKI-021 measured