mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Show news from the window the server serves
A host may serve fewer hours than the day. The hotspots answer may name its window (`windowHours`, a whole number from 1 to 24); the layer keeps reports, the feed, In view and the chosen event inside it, and the panel says "Last 12 h" or "Last 24 h" accordingly. Without a window named, or with one out of range, the layer keeps the full day as before.
This commit is contained in:
1 parent
f3e206bf37
commit
60fad38c3f
18 files changed
+178
-73
No files matched your search
@@ -76,6 +76,7 @@ function view(extra = {}) {
|
||||
inView: { active: false, loading: false, error: null, items: [] },
|
||||
selected: null,
|
||||
hasMore: true,
|
||||
windowHours: 24,
|
||||
loading: false,
|
||||
error: null,
|
||||
...extra,
|
||||
@@ -276,3 +277,12 @@ test('scrolling to the end asks once per page, again after a filter change or a
|
||||
assert.equal(loadMores(), 3);
|
||||
news.destroy();
|
||||
});
|
||||
|
||||
test('the panel names the window the server serves', () => {
|
||||
const { news, panel } = fixture();
|
||||
news.update(view({ windowHours: 12 }));
|
||||
assert.equal(
|
||||
panel.querySelector('.news-readout__window').textContent,
|
||||
'Last 12 h',
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user