diff --git a/cypress/e2e/map.cy.ts b/cypress/e2e/map.cy.ts index 751d2fc..89fcb4d 100644 --- a/cypress/e2e/map.cy.ts +++ b/cypress/e2e/map.cy.ts @@ -95,4 +95,19 @@ describe("Map", () => { cy.url().should("not.contain", "lng=-82.401078"); }); + + it.only("Attribution control displays the proper message and link", () => { + loadMap("/"); + + cy.get(".leaflet-control-attribution").contains( + "Brought to you by HackGreenville Labs. Click here to contribute!" + ); + + // Get contribution link and ensure that the URL is as expected + cy.get( + ".leaflet-control-container > div.leaflet-bottom.leaflet-right > div > a:nth-child(2)" + ) + .should("have.attr", "href") + .and("match", /https:\/\/data.openupstate.org\/contribute/); + }); }); diff --git a/src/@vue-leaflet/vue-leaflet.d.ts b/src/@vue-leaflet/vue-leaflet.d.ts index 98bd856..210c253 100644 --- a/src/@vue-leaflet/vue-leaflet.d.ts +++ b/src/@vue-leaflet/vue-leaflet.d.ts @@ -2,4 +2,5 @@ declare module "@vue-leaflet/vue-leaflet" { import type { DefineComponent } from "vue"; export const LMap: DefineComponent; export const LTileLayer: DefineComponent; + export const LControlAttribution: DefineComponent; } diff --git a/src/components/MainMap.vue b/src/components/MainMap.vue index 7972ec8..2a143b3 100644 --- a/src/components/MainMap.vue +++ b/src/components/MainMap.vue @@ -5,7 +5,11 @@ import type { Map, GeoJSON, LayersControlEvent } from "leaflet";