diff --git a/datatypes/epc/domain/tests/test_from_sap_schema.py b/datatypes/epc/domain/tests/test_from_sap_schema.py index 0612f523..c5daa082 100644 --- a/datatypes/epc/domain/tests/test_from_sap_schema.py +++ b/datatypes/epc/domain/tests/test_from_sap_schema.py @@ -137,6 +137,34 @@ class TestFromSapSchema17_1RebaselineFields: assert result.assessment_type == "SAP" +class TestFromSapSchema17_1DisplayElements: + """Display EnergyElements the WIP mapper dropped, leaving the FE + property-details panel "Unknown" for full-SAP certs (ADR-0037). Brings + full-SAP to parity with from_rdsap_schema_17_1's display coverage.""" + + @pytest.fixture + def result(self) -> EpcPropertyData: + schema = from_dict(SapSchema17_1, load("sap_17_1.json")) + return EpcPropertyDataMapper.from_sap_schema_17_1(schema) + + def test_maps_main_heating_display_list(self, result: EpcPropertyData) -> None: + assert [e.description for e in result.main_heating] == [ + "Boiler and radiators, mains gas" + ] + + def test_maps_window_display_element(self, result: EpcPropertyData) -> None: + assert result.window is not None + assert result.window.description == "High performance glazing" + + def test_maps_lighting_display_element(self, result: EpcPropertyData) -> None: + assert result.lighting is not None + assert result.lighting.description == "Low energy lighting in all fixed outlets" + + def test_maps_hot_water_display_element(self, result: EpcPropertyData) -> None: + assert result.hot_water is not None + assert result.hot_water.description == "From main system" + + class TestFullSapHasHotWaterCylinderFallback: """Some full-SAP certs (e.g. SAP-Schema-17.0 cert 8265-7433-3220-9736-7902) omit the top-level `has_hot_water_cylinder` and lodge it only under