Skip to content

Commit d9e4ea1

Browse files
committed
test: cover runtime-composed trip gap label
1 parent b7d6c7c commit d9e4ea1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/frontend-i18n.test.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const LANGUAGES = [
2727
];
2828
const EXTRA_LANGUAGES = LANGUAGES.filter((language) => !["de", "en", "fr"].includes(language));
2929
const NAMESPACES = ["tripHistory", "chargeHistory", "vehicleOverview", "dashboard", "dualEnergyOverview", "fuelHistory"];
30-
const CAPABILITY_EXCEPTIONS = {};
30+
// reconstructedGap is intentionally composed in i18n.js because it is a
31+
// frontend-only provenance label shared by all 18 languages in one place.
32+
const CAPABILITY_EXCEPTIONS = { tripHistory: new Set(["reconstructedGap"]) };
3133
const baseCatalogs = Object.assign({}, WESTERN_TEXT, NORTHERN_TEXT, EASTERN_TEXT);
3234
const advancedCatalogs = Object.assign({}, WESTERN_ADVANCED, NORTHERN_ADVANCED, EASTERN_ADVANCED);
3335

@@ -158,6 +160,7 @@ test("trip and charge cards use HA locale when language is automatic", () => {
158160
test("localized custom cards consume catalog keys instead of hard-coded German UI text", () => {
159161
assert.match(trip, /text\.compactFilterNote/);
160162
assert.match(trip, /text\.visibleTrips/);
163+
assert.match(trip, /text\.reconstructedGap/);
161164
assert.match(charge, /text\.batteryEnergy/);
162165
assert.match(charge, /text\.reconstructedHint/);
163166
assert.match(vehicle, /textFor\(hass, "vehicleOverview"\)/);
@@ -189,4 +192,4 @@ test("dashboard strategy uses catalog strings without binary German branches", (
189192
assert.match(strategy, new RegExp(`strings\\.${key}`));
190193
}
191194
assert.doesNotMatch(strategy, /Zeit unbekannt|seit gerade eben|Verbunden|Getrennt|ABRP Live-Daten/);
192-
});
195+
});

0 commit comments

Comments
 (0)