Fix entity translations
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from unittest.mock import Mock
|
||||
|
||||
from custom_components.arkteos.binary_sensor import ArkteosConnectionBinarySensor
|
||||
@@ -28,6 +30,16 @@ def test_unique_id_is_stable() -> None:
|
||||
assert ArkteosConnectionBinarySensor(FakeClient()).unique_id == "arkteos_zuran4_connection"
|
||||
|
||||
|
||||
def test_connectivity_translation_is_present_and_specific() -> None:
|
||||
entity = ArkteosConnectionBinarySensor(FakeClient())
|
||||
french = json.loads(
|
||||
(Path(__file__).parents[1] / "custom_components" / "arkteos" / "translations" / "fr.json").read_text()
|
||||
)
|
||||
assert entity.has_entity_name
|
||||
assert entity.translation_key == "connectivity"
|
||||
assert french["entity"]["binary_sensor"]["connectivity"]["name"] == "Connexion"
|
||||
|
||||
|
||||
def test_device_info_is_correct() -> None:
|
||||
info = ArkteosConnectionBinarySensor(FakeClient()).device_info
|
||||
assert info["identifiers"] == {(DOMAIN, "arkteos_zuran4")}
|
||||
|
||||
Reference in New Issue
Block a user