Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ repos:
- hooks:
- id: python-safety-dependencies-check
repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.4.0
rev: v1.4.2
- hooks:
- id: beautysh
repo: https://github.com/bemeurer/beautysh.git
Expand Down
35 changes: 35 additions & 0 deletions front/components.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* eslint-disable */
// @ts-nocheck
// Generated by unplugin-vue-components
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J’ai l’impression que ce fichier doit être .gitignoré, et sinon, comment le génère-t-on ? 

Copy link
Contributor Author

@QuentinMadura QuentinMadura Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non il n'a pas vocation à être .gitignoré. Ça vient remplacer globalement les imports que tu fais dans tes composants. Il se génère automatiquement dès que tu importes un nouveau composant !

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J’ai tendance à me dire que tout ce qui se génère automatiquement peut-être .gitignoré. Ça changerait qqch qu’il soit .gitignoré ?

// Read more: https://github.com/vuejs/core/pull/3399
// biome-ignore lint: disable
export {}

/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
Button: typeof import('primevue/button')['default']
ClimateZoneScorePopupContent: typeof import('./src/components/map/popup/ClimateZoneScorePopupContent.vue')['default']
ClimateZonesLegend: typeof import('./src/components/map/legend/ClimateZonesLegend.vue')['default']
FeedbackForm: typeof import('./src/components/forms/FeedbackForm.vue')['default']
FeedbackPopin: typeof import('./src/components/FeedbackPopin.vue')['default']
InputText: typeof import('primevue/inputtext')['default']
LayerSwitcher: typeof import('./src/components/map/layerSwitcher/LayerSwitcher.vue')['default']
MapComponent: typeof import('./src/components/map/MapComponent.vue')['default']
MapLayerSwitcher: typeof import('./src/components/map/layerSwitcher/MapLayerSwitcher.vue')['default']
MapLegend: typeof import('./src/components/map/legend/MapLegend.vue')['default']
MapScorePopup: typeof import('./src/components/map/popup/MapScorePopup.vue')['default']
Message: typeof import("primevue/message")["default"]
NavbarComponent: typeof import('./src/components/navbar/NavbarComponent.vue')['default']
PlantabilityLegend: typeof import('./src/components/map/legend/PlantabilityLegend.vue')['default']
PlantabilityScorePopupContent: typeof import('./src/components/map/popup/PlantabilityScorePopupContent.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
ScoreLabel: typeof import('./src/components/map/ScoreLabel.vue')['default']
Textarea: typeof import('primevue/textarea')['default']
Toast: typeof import('primevue/toast')['default']
VulnerabilityLegend: typeof import('./src/components/map/legend/VulnerabilityLegend.vue')['default']
VulnerabilityScorePopupContent: typeof import('./src/components/map/popup/VulnerabilityScorePopupContent.vue')['default']
VulnerabilityScorePopupItem: typeof import('./src/components/map/popup/VulnerabilityScorePopupItem.vue')['default']
}
}
15 changes: 2 additions & 13 deletions front/cypress/components/FeedbackPopin.cy.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
import FeedbackPopin from "@/components/FeedbackPopin.vue"

describe("FeedbackPopin", () => {
it("renders correctly", () => {
cy.mount(FeedbackPopin)
cy.getBySel("submit-feedback-button").should("exist")
cy.getBySel("close-feedback-button").should("exist")
})

it("correctly send feedback", () => {
cy.mount(FeedbackPopin, {
props: {
allowedExtensions: []
visible: true
},
emits: {
"submit-feedback": cy.spy().as("submit-feedback")
}
})

cy.getBySel("submit-feedback-button").click()
cy.get("@submit-feedback").should("have.been.calledWith", { email: "", feedback: "" })

const testEmail = "molly.maguire@test.fr"
const testFeedback = "Raise the floor, not just the ceiling."
cy.get("textarea").type(testFeedback)
cy.get('input[type="email"]').type(testEmail)
cy.get("textarea").type(testFeedback)
cy.getBySel("submit-feedback-button").click()

// Check if the event was passed with the correct values
cy.get("@submit-feedback").should("have.been.calledWith", {
email: testEmail,
feedback: testFeedback
Expand Down
2 changes: 1 addition & 1 deletion front/cypress/components/MapLegend.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import VulnerabilityLegend from "@/components/map/legend/VulnerabilityLegend.vue

describe("Map legends", () => {
it("renders correctly plantability legend", () => {
cy.mount(PlantabilityLegend)
cy.mount(PlantabilityLegend, {})
cy.contains(0)
cy.contains(2)
cy.contains(4)
Expand Down
2 changes: 1 addition & 1 deletion front/cypress/components/NavbarComponent.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Navbar from "@/components/NavbarComponent.vue"
import Navbar from "@/components/navbar/NavbarComponent.vue"

describe("Navbar", () => {
beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions front/cypress/e2e/mapInteractions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("Map interactions", () => {
cy.mapOpenPopup()
cy.getBySel("plantability-score-label").should("exist")

cy.mapSwitchLayer(DataType.LOCAL_CLIMATE_ZONES) // cf. issue #142
cy.mapSwitchLayer(DataTypeToLabel[DataType.LOCAL_CLIMATE_ZONES]) // cf. issue #142
cy.url().should("include", "/lcz/")
cy.getBySel("map-legend-title").should("contain", DataTypeToLabel[DataType.LOCAL_CLIMATE_ZONES])
cy.mapHasNoPopup()
Expand All @@ -30,7 +30,7 @@ describe("Map interactions", () => {
cy.mapClosePopup()
cy.mapOpenPopup() // cf. issue #92

cy.mapSwitchLayer(DataType.VULNERABILITY)
cy.mapSwitchLayer(DataTypeToLabel[DataType.VULNERABILITY])
cy.url().should("include", "/vulnerability/")
cy.getBySel("map-legend-title").should("contain", DataTypeToLabel[DataType.VULNERABILITY])
cy.mapHasNoPopup()
Expand Down
2 changes: 1 addition & 1 deletion front/cypress/e2e/mapPopinInteractions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("Feedback Popin interactivity", () => {
it("Open, close and reopen feedback popin", () => {
cy.getBySel("open-feedback-button").click()

cy.getBySel("close-feedback-button").click()
cy.get("[data-pc-name='pcclosebutton']").click()
cy.getBySel("feedback-popin").should("not.exist")

cy.getBySel("open-feedback-button").click()
Expand Down
3 changes: 2 additions & 1 deletion front/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ Cypress.Commands.add("mapClosePopup", () => {
})

Cypress.Commands.add("mapSwitchLayer", (datatype: string) => {
cy.getBySel("layer-switcher").get("select").select(datatype)
cy.getBySel("layer-switcher").click()
cy.getBySel("layer-switcher").get(".p-select-option-label").contains(datatype).click()
})
28 changes: 22 additions & 6 deletions front/cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import "./commands"

import "@/styles/main.css"

// Alternatively you can use CommonJS syntax:
// require('./commands')
import Primevue from "primevue/config"

import { mount } from "cypress/vue"
import { IArbrePreset } from "../../src/theme/iArbre"
import ToastService from "primevue/toastservice"

// Augment the Cypress namespace to include type definitions for
// your custom command.
Expand All @@ -35,7 +35,23 @@ declare global {
}
}

Cypress.Commands.add("mount", mount)
Cypress.Commands.add("mount", (component, options) => {
// Setup options object
if (!options) {
options = {}
}
options.global = options.global || {}
options.global.plugins = options?.global.plugins || []
options.global.plugins.push({
install(app) {
app.use(Primevue, {
theme: {
preset: IArbrePreset
}
})
app.use(ToastService)
}
})

// Example use:
// cy.mount(MyComponent)
return mount(component, options)
})
Loading
Loading