24 lines
772 B
Python
24 lines
772 B
Python
from pathlib import Path
|
|
import unittest
|
|
|
|
|
|
CALCULATOR_HTML = Path(__file__).parents[1] / "web" / "calculator.html"
|
|
|
|
|
|
class CalculatorWebTests(unittest.TestCase):
|
|
def test_coaching_today_button_uses_the_shared_today_handler(self):
|
|
html = CALCULATOR_HTML.read_text(encoding="utf-8")
|
|
|
|
self.assertIn('id="todayBtn" class="today-btn quick-btn"', html)
|
|
self.assertIn("document.querySelectorAll('.today-btn')", html)
|
|
|
|
def test_report_dates_default_to_today_instead_of_a_fixed_date(self):
|
|
html = CALCULATOR_HTML.read_text(encoding="utf-8")
|
|
|
|
self.assertNotIn('name="date" value="15.08"', html)
|
|
self.assertIn("document.querySelectorAll('.today-btn').forEach(setToday);", html)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|