Skip to content
Snippets Groups Projects
Commit 53eeac5c authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

fix: handle pdl starting with 0

parent 8f573ba4
No related branches found
No related tags found
2 merge requests!80MEP 2.5: fix 13 digits PDL,!79fix: handle pdl starting with 0
......@@ -16,7 +16,7 @@ type Consent struct {
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Address string `json:"address"`
PointID int `json:"pointID"`
PointID string `json:"pointID"`
PostalCode string `json:"postalCode"`
City string `json:"city"`
SafetyBoarding bool `json:"safetyOnBoarding"`
......
......@@ -30,9 +30,9 @@ var (
partnersInfoStr string
customPopupInfo = models.CustomPopup{ID: 1, PopupEnabled: false, Title: "Alerte personnalisée", Description: "Ecolyo 4ever"}
customPopupStr string
consent = models.Consent{Firstname: "Foo", Lastname: "Bar", PointID: 123456}
consent = models.Consent{Firstname: "Foo", Lastname: "Bar", PointID: "12345671234567"}
consentStr string
otherConsent = models.Consent{Firstname: "John", Lastname: "Doe", PointID: 123789}
otherConsent = models.Consent{Firstname: "John", Lastname: "Doe", PointID: "01234560123456"}
otherConsentStr string
noH map[string]string
)
......@@ -272,11 +272,11 @@ func sgeTests(t *testing.T) {
// Try to get first 50 consents (must pass)
do("GET", "/api/admin/consent?limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":2,"rows":[{"ID":2`)
// Try to search for both consent (must pass)
do("GET", "/api/admin/consent?search=123&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":2,"rows":[{"ID":2`)
do("GET", "/api/admin/consent?search=123456&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":2,"rows":[{"ID":2`)
// Try to search for first point id (must pass)
do("GET", "/api/admin/consent?search=123456&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":1,"rows":[{"ID":1`)
do("GET", "/api/admin/consent?search=12345671234567&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":1,"rows":[{"ID":1`)
// Try to search for second point id (must pass)
do("GET", "/api/admin/consent?search=123789&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":1,"rows":[{"ID":2`)
do("GET", "/api/admin/consent?search=01234560123456&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":1,"rows":[{"ID":2`)
// Try to search for unknown point id (must pass empty)
do("GET", "/api/admin/consent?search=000000&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":0,"rows":[]`)
// Try to delete a consent (must pass)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment