aboutsummaryrefslogtreecommitdiff
path: root/tests/test-wttrin-smoke.el
Commit message (Collapse)AuthorAgeFilesLines
* feat: unified cache and staleness handling for mode-line and bufferCraig Jennings2026-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace TTL-based cache invalidation with proactive scheduled refresh. Both mode-line and buffer systems now follow: timer refreshes cache, display reads from cache, staleness indicated when data is old. Phase 1 - Mode-line cache formalization + staleness display: - Replace wttrin--mode-line-tooltip-data with wttrin--mode-line-cache as (timestamp . data) cons cell matching buffer cache pattern - Add wttrin--format-age helper for human-readable age strings - Rewrite wttrin--mode-line-update-display to take no arguments, read from cache, compute staleness (age > 2x refresh interval), dim emoji gray when stale, show staleness info in tooltip - Rewrite wttrin--mode-line-fetch-weather to write cache on success, show stale display on failure with cache, error placeholder without - Add wttrin--mode-line-update-placeholder-error for first-launch failure Phase 2 - Remove TTL, add proactive buffer refresh: - Rename wttrin-cache-ttl to wttrin-refresh-interval (default 3600s) with define-obsolete-variable-alias for backward compatibility - Change wttrin-mode-line-refresh-interval default from 900 to 3600 - Remove TTL check from wttrin--get-cached-or-fetch; serve cached data regardless of age, background timer keeps it fresh - Add buffer refresh timer (wttrin--buffer-cache-refresh) Phase 3 - Buffer staleness display: - Add wttrin--format-staleness-header for buffer age display - Insert staleness line in wttrin--display-weather before instructions Phase 4 - Cleanup: - Remove all references to wttrin--mode-line-tooltip-data - Update README.org cache settings and mode-line documentation - Update tests for new API (198 tests across 21 files, all passing)
* refactor: tests: standardize naming, consolidate files, and expand testutilCraig Jennings2026-02-171-0/+11
| | | | | | | | | | | | | | | | | - Expand testutil-wttrin.el with shared fixtures and macros (testutil-wttrin-with-clean-weather-buffer, testutil-wttrin-mock-http-response, sample ANSI/weather constants) - Consolidate cache tests: port unique tests from cleanup-cache-constants and cleanup-cache-refactored into cleanup-cache-if-needed, delete obsolete files - Extract startup-delay tests into dedicated file - Add setup/teardown and (require 'testutil-wttrin) to all test files - Rename all 160 tests to follow test-<module>-<category>-<scenario>-<expected-result> convention - Rename integration test file and add detailed docstrings - Update Makefile glob to discover new integration test naming pattern Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: core: rename wttrin-mode-line-favorite-location to ↵Craig Jennings2025-11-131-1/+1
| | | | | | | | wttrin-favorite-location Renamed variable to remove 'mode-line' prefix, making it usable for future location-based features beyond mode-line display. Updated all references in code, tests, and documentation. All 187 tests passing.
* refactor: core: lazy-load xterm-color dependencyCraig Jennings2025-11-081-2/+2
| | | | | | | | | | | | | | | | | Move xterm-color from top-level require to on-demand loading within functions that actually use it. This simplifies user configuration by eliminating the need for separate xterm-color use-package declarations. Changes: - Replace top-level (require 'xterm-color) with declare-function - Add (require 'xterm-color) in wttrin--process-weather-content - Add (require 'xterm-color) in wttrin--display-weather - Update smoke test to check loadability vs. feature presence Benefits: - Simpler use-package config (no :after xterm-color needed) - xterm-color still auto-installed via Package-Requires on MELPA - Load time optimization (loads only when displaying weather)
* test: smoke: reorganize test suite following quality-engineer.org naming ↵Craig Jennings2025-11-081-0/+121
conventions - Create test-wttrin-smoke.el with 15 smoke tests for package sanity checks - Delete test-wttrin-integration.el (misnamed, contained smoke tests not integration tests) - Remove redundant functional tests already covered in dedicated unit test files - URL building: covered by test-wttrin--build-url.el (12 tests) - Cache operations: covered by test-wttrin--get-cached-or-fetch.el (11 tests) - Mode-line display: covered by test-wttrin--mode-line-map.el Smoke tests verify: - Package loads without errors - Dependencies available (xterm-color, url) - Public API exists and is interactive - Configuration variables defined - Keymaps exist and are valid - Package metadata correct (version, autoload cookies) Final test organization: 18 files, 162 tests (15 smoke + 142 unit + 5 integration)