"""Tests for the web_server component index page builder and validation.""" import logging import pytest from esphome.components.web_server import ( _final_validate_ap_only_hosted_ui, build_index_html, ) from esphome.const import ( CONF_AP, CONF_CSS_URL, CONF_JS_URL, CONF_LOCAL, CONF_NETWORKS, CONF_SSID, CONF_WIFI, ) import esphome.final_validate as fv JS_URL = "https://oi.esphome.io/v2/www.js" def test_build_index_html_has_offline_hint() -> None: """A hidden hint is shown after a timeout unless www.js registered esp-app.""" html = build_index_html({CONF_JS_URL: JS_URL, CONF_CSS_URL: ""}) assert "" in html assert "