mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
fix: improve mapped installations and map-source guidance (#183)
Improve mapped installation recovery, deselection, retry feedback, and visual-style and map-source guidance.
This commit is contained in:
1 parent
3b6b3f1007
commit
759652207f
25 files changed
+479
-41
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { installationFeedback } from './installationFeedback.js';
|
||||
|
||||
test('retry copy follows the real deadline and does not promise an overdue timer fired', () => {
|
||||
assert.equal(installationFeedback({ retryAt: 31000 }, 1000), 'Overpass temporarily unavailable — retrying in 30s');
|
||||
assert.match(installationFeedback({ retryAt: 31000 }, 32000), /retry pending$/);
|
||||
assert.match(installationFeedback({ retryAt: 241000 }, 1000), /240s$/);
|
||||
});
|
||||
test('only known failure reasons get specific attribution', () => {
|
||||
for (const [failureReason, text] of [['rate_limited', 'rate-limited'], ['timeout', 'timed out'], ['query_failed', 'could not complete']]) {
|
||||
assert.ok(installationFeedback({ status: 'unavailable', failureReason }).includes(text));
|
||||
}
|
||||
assert.match(installationFeedback({ status: 'unavailable', failureReason: 'unknown' }), /temporarily unavailable/);
|
||||
});
|
||||
test('first fetch, retry, cached data and success have distinct copy', () => {
|
||||
assert.equal(installationFeedback({ loading: true }), 'Fetching mapped sites…');
|
||||
assert.equal(installationFeedback({ loading: true, retrying: true }), 'Retrying mapped sites…');
|
||||
assert.equal(installationFeedback({ status: 'ready' }), 'Mapped sites loaded');
|
||||
assert.equal(installationFeedback({ stale: true }), 'Showing cached mapped sites');
|
||||
});
|
||||
Reference in new issue
Block a user