mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-08 07:52:20 +02:00
Merge lab into test/document-module-set-helper
Resolve the overlap with #19 by preserving the whole-cascade stylesheet helpers alongside #31's document-source/module-set helpers. Maintainer validation: - document/module contract and composition guards: 15 passed - all 54 touched Python test modules: 366 passed - py_compile: clean - git diff --check: clean
This commit is contained in:
@@ -3,12 +3,13 @@
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from tests.helpers.stylesheets import app_css
|
||||
from tests.helpers.stylesheets import stylesheet_link_tags
|
||||
from tests.helpers.document_source import declaration, document_source, function_body
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
DOC_JS = document_source()
|
||||
STYLE = (ROOT / "static/style.css").read_text(encoding="utf-8")
|
||||
STYLE = app_css()
|
||||
|
||||
|
||||
def test_heading_levels_and_page_break_are_exposed_everywhere():
|
||||
@@ -39,7 +40,7 @@ def test_mobile_headings_page_break_history_and_persistence():
|
||||
const browser = await chromium.launch({ headless: true });
|
||||
const page = await browser.newPage({ viewport: { width: 390, height: 844 } });
|
||||
await page.goto(`${process.env.ODYSSEUS_TEST_STATIC_ORIGIN}/static/js/documentStats.js`);
|
||||
await page.setContent('<link rel="stylesheet" href="/static/style.css?v=20260831richtexttools91"><div id="toast"></div><div id="chat-container"></div><div id="sidebar"></div>');
|
||||
await page.setContent('__ODY_STYLESHEETS__<div id="toast"></div><div id="chat-container"></div><div id="sidebar"></div>');
|
||||
await page.evaluate(async () => {
|
||||
const mod = await import('/static/js/document.js?v=20260831richtexttools91&structure-tools-test=1');
|
||||
window.__structureToolsDocModule = mod;
|
||||
@@ -147,6 +148,7 @@ def test_mobile_headings_page_break_history_and_persistence():
|
||||
}));
|
||||
await browser.close();
|
||||
"""
|
||||
script = script.replace("__ODY_STYLESHEETS__", stylesheet_link_tags())
|
||||
result = subprocess.run(
|
||||
["node", "--input-type=module", "-e", script],
|
||||
cwd=ROOT,
|
||||
|
||||
Reference in New Issue
Block a user