diff --git a/CHANGELOG.md b/CHANGELOG.md index 10a5efca..0c68953b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Fixed an issue when clicking on a popup and then clicking on the map again - Fix modal close button possition - Fixed an issue with the generation of tranlations +- Fix missing spec info when clicking next to a property - _...Add new stuff here..._ ## 3.0.0 diff --git a/cypress/e2e/layers.cy.ts b/cypress/e2e/layers.cy.ts index 90b61950..4c5093f0 100644 --- a/cypress/e2e/layers.cy.ts +++ b/cypress/e2e/layers.cy.ts @@ -467,6 +467,30 @@ describe("layers", () => { ], }); }); + + it("should show spec info when hovering and clicking single line property", () => { + when.modal.fillLayers({ + type: "symbol", + layer: "example", + }); + + when.hover("spec-field-container:text-rotate"); + then(get.elementByTestId("field-doc-button-Rotate")).shouldBeVisible(); + when.click("field-doc-button-Rotate", 0); + then(get.elementByTestId("spec-field-doc")).shouldContainText("Rotates the "); + }); + + it("should show spec info when hovering and clicking multi line property", () => { + when.modal.fillLayers({ + type: "symbol", + layer: "example", + }); + + when.hover("spec-field-container:text-offset"); + then(get.elementByTestId("field-doc-button-Offset")).shouldBeVisible(); + when.click("field-doc-button-Offset", 0); + then(get.elementByTestId("spec-field-doc")).shouldContainText("Offset distance"); + }); }); describe("raster", () => { diff --git a/src/components/App.tsx b/src/components/App.tsx index 9ba85167..b666d2a6 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -8,7 +8,8 @@ import {arrayMoveMutable} from 'array-move' import hash from "string-hash"; import { PMTiles } from "pmtiles"; import {Map, LayerSpecification, StyleSpecification, ValidationError, SourceSpecification} from 'maplibre-gl' -import {latest, validateStyleMin} from '@maplibre/maplibre-gl-style-spec' +import {validateStyleMin} from '@maplibre/maplibre-gl-style-spec' +import latest from '@maplibre/maplibre-gl-style-spec/dist/latest.json' import MapMaplibreGl from './MapMaplibreGl' import MapOpenLayers from './MapOpenLayers'