Skip to content

Commit

Permalink
Fix MissingCardPage not showing when no card is detected
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashbrnrd committed Jun 17, 2024
1 parent 400ac4f commit bc3e7e3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1,210 deletions.
5 changes: 5 additions & 0 deletions backend/src/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ async def imageupload(
if label in TYPOLOGIES_MEASURED:
gun_length, gun_barrel_length, conf_card = get_lengths(img_bytes)

# Temporary fix while ML package send 0 instead of None
# https://github.com/dnum-mi/basegun-ml/issues/14
gun_length = None if gun_length == 0 else gun_length
gun_barrel_length = None if gun_barrel_length == 0 else gun_barrel_length

extras_logging["bg_label"] = label
extras_logging["bg_confidence"] = confidence
extras_logging["bg_gun_length"] = gun_length
Expand Down
2 changes: 2 additions & 0 deletions frontend/cypress/e2e/firearm-fiability.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ describe("Firearm Fiability", () => {
cy.wait("@upload").then(({ response }) => {
expect(response.statusCode).to.eq(200);
});
cy.url().should("contain", "/carte-manquante");
cy.contains("Je souhaite tout de même poursuivre").click();
cy.url().should("contain", "/guide-identification/resultat-typologie");
cy.contains("h2", "Typologie non déterminée");
});
Expand Down
2 changes: 2 additions & 0 deletions frontend/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ Cypress.Commands.add("arrierePlatRevolver", () => {
Cypress.Commands.add("IdentificationShoulderBoltRifle", () => {
cy.url().should("contain", "/fin-mise-en-securite");
cy.getByDataTestid("go-to-identification").click();
cy.url().should("contain", "/carte-manquante");
cy.contains("Je souhaite tout de même poursuivre").click();
cy.url().should("contain", "/resultat-typologie");
cy.getByDataTestid("next-step").click();
cy.url().should(
Expand Down
Loading

0 comments on commit bc3e7e3

Please sign in to comment.