mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
feat(ui): render the location tray's pills, mini status and search error from a store
LocationControls (./ui/location) no longer builds the city and landmark pills or writes the mini status and the search error: it presents the tray and hands it to its publish option, so the entry stays Vue-free. The shell publishes it to a new gev-location store and connects the controls, and the dock renders it and calls chooseCity() and choosePoi(). The landmark row still expands a frame after its pills render. The search field, its toggle and the reset buttons keep their listeners. The location QA harness reads the rendered elements.
This commit is contained in:
1 parent
4966877859
commit
5f8f9bb921
14 files changed
+333
-141
No files matched your search
@@ -52,17 +52,13 @@ function element() {
|
||||
test('ru: location pills and the mini-status show the translated city', () => {
|
||||
setLocale('ru');
|
||||
const elements = {
|
||||
pills: element(),
|
||||
poiRow: element(),
|
||||
divider: element(),
|
||||
search: element(),
|
||||
searchToggle: element(),
|
||||
resetButtons: [],
|
||||
statusCity: element(),
|
||||
statusPoi: element(),
|
||||
};
|
||||
const doc = { ...element(), createElement: element };
|
||||
const cities = { tokyo: CITY_POIS.tokyo };
|
||||
const views = [];
|
||||
const controls = new LocationControls({
|
||||
elements,
|
||||
cities,
|
||||
@@ -71,12 +67,13 @@ test('ru: location pills and the mini-status show the translated city', () => {
|
||||
onPoi() {},
|
||||
onSearch() {},
|
||||
onReset() {},
|
||||
publish: (view) => views.push(view),
|
||||
doc,
|
||||
requestFrame: () => 0,
|
||||
cancelFrame() {},
|
||||
});
|
||||
assert.equal(elements.pills.children[0].textContent, 'Токио');
|
||||
assert.equal(views.at(-1).cities[0].label, 'Токио');
|
||||
controls.renderStatus({ city: CITY_POIS.tokyo, currentPoi: null });
|
||||
assert.equal(elements.statusCity.textContent, '📍 Токио');
|
||||
assert.equal(views.at(-1).status.city, '📍 Токио');
|
||||
assert.equal(CITY_POIS.tokyo.name, 'Tokyo');
|
||||
});
|
||||
Reference in new issue
Block a user