yeg-relief / youcanbenefit

YouCanBenefit is a web application that increases social benefit program discoverability for people of lesser means and their allies.
https://youcanbenefit.edmonton.ca
MIT License
13 stars 9 forks source link

Fix snapshot testing #74

Closed j-rewerts closed 5 years ago

j-rewerts commented 5 years ago

We currently have problems with reproducibility. Our snapshots often change:

      Object {
        "guid": "hp5mupqcVY8ZMiKg7Q91Uoi4Wf",
        "queryIDs": Array [
    -     "C8NZoL1Nf7VEgEC4VMFI9GlebN",
          "d5NswIlUvzxY0AJ1hGm4eKQtS4",
    +     "fMwdx1jiAZUt09ALDer98GardT",
          "JeXk8cOZnqJMepmHpxDqpsEXNE",
          "jI1HlTlpbULsSVUmHnYi3ZlVJ7",
          "jzMQkEK41gnhmwWyxAuWF3eZ4d",
          "NOyR66aE30dJYXgdHJ2CvGLpnx",
          "qZyokzKnpIw3Ue6mdTi8je3knK",

We need our snapshots to be the exact same between runs.

CodyGramlich commented 5 years ago

This seems to be only a problem with GET /protected/program/:guid. It only returns 10 queries when there are 11 queries for this program. The search size for elasticsearch wasn't set on EsQuery.service.ts getByGuid(), so I changed it to a size of 10000. Also, I don't think this endpoint is ever used in the application currently.

j-rewerts commented 5 years ago

Fixed by @CodyGramlich with #87.