Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Whitestone
d31468fe2b fix: add manifest.json, link it in help.html, add tests
Some checks failed
CI / validate (pull_request) Failing after 12s
- manifest.json already present; add <link rel="manifest"> to help.html
  so all Nexus HTML pages declare PWA support consistently
- add tests/test_manifest.py to verify manifest exists, is valid JSON,
  has required PWA fields, and is referenced from both index.html and help.html

Fixes #832

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 13:58:32 -04:00
2 changed files with 40 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&family=Orbitron:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="manifest" href="./manifest.json">
<style>
:root {
--color-bg: #050510;

39
tests/test_manifest.py Normal file
View File

@@ -0,0 +1,39 @@
"""Tests for manifest.json PWA support. Fixes #832 (Missing manifest.json)."""
import json
from pathlib import Path
def test_manifest_exists() -> None:
assert Path("manifest.json").exists(), "manifest.json must exist for PWA support"
def test_manifest_is_valid_json() -> None:
content = Path("manifest.json").read_text()
data = json.loads(content)
assert isinstance(data, dict)
def test_manifest_has_required_pwa_fields() -> None:
data = json.loads(Path("manifest.json").read_text())
assert "name" in data, "manifest.json must have 'name'"
assert "short_name" in data, "manifest.json must have 'short_name'"
assert "start_url" in data, "manifest.json must have 'start_url'"
assert "display" in data, "manifest.json must have 'display'"
assert "icons" in data, "manifest.json must have 'icons'"
def test_manifest_icons_non_empty() -> None:
data = json.loads(Path("manifest.json").read_text())
assert len(data["icons"]) > 0, "manifest.json must define at least one icon"
def test_index_html_references_manifest() -> None:
content = Path("index.html").read_text()
assert 'rel="manifest"' in content, "index.html must have <link rel=\"manifest\">"
assert "manifest.json" in content, "index.html must reference manifest.json"
def test_help_html_references_manifest() -> None:
content = Path("help.html").read_text()
assert 'rel="manifest"' in content, "help.html must have <link rel=\"manifest\">"
assert "manifest.json" in content, "help.html must reference manifest.json"