mirror of
https://github.com/zensical/zensical.git
synced 2026-09-26 00:05:50 +00:00
fix: relax search validation (#926)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
This commit is contained in:
+23
@@ -33,6 +33,8 @@ import zensical
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
_BUILD_OPTIONS: dict[str, Any] = {"clean": False, "strict": False}
|
||||
|
||||
@@ -149,6 +151,27 @@ def test_search_artifacts_match_mkdocs_contract(tmp_path: Path) -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_unsupported_material_options_are_silently_ignored(
|
||||
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
||||
) -> None:
|
||||
"""Known Material options are ignored to keep migration frictionless."""
|
||||
config = _write_project(
|
||||
tmp_path,
|
||||
plugins=(
|
||||
" - material/search:\n"
|
||||
" lang:\n"
|
||||
" - de\n"
|
||||
" pipeline:\n"
|
||||
" - stemmer"
|
||||
),
|
||||
)
|
||||
|
||||
zensical.build(str(config), _BUILD_OPTIONS)
|
||||
|
||||
assert _read_index(tmp_path)["config"]["lang"] == ["en"]
|
||||
assert capsys.readouterr().err == ""
|
||||
|
||||
|
||||
def test_search_exclusion_and_disabled_output(tmp_path: Path) -> None:
|
||||
"""Excluded pages contribute no items and disabled search stays valid."""
|
||||
config = _write_project(tmp_path, plugins=" search:\n enabled: true")
|
||||
|
||||
Reference in New Issue
Block a user