Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27391

Fix user enricher test on a fresh Nuxeo server

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Rest API

      Description

      Install the nuxeo/nuxeo:master Docker image and run

      yarn test user-enricher
      
        ● GET /user/USER_ID enrichers.users=userprofile > existing user profile
      
          expect(received).toMatchObject(expected)
      
          - Expected
          + Received
      
          @@ -1,13 +1,13 @@
            Object {
              "contextParameters": Object {
                "userprofile": Object {
                  "avatar": null,
          -       "birthdate": "1980-12-20T00:00:00.000Z",
          +       "birthdate": null,
                  "gender": false,
          -       "locale": "en",
          -       "phonenumber": "06 78 65 98 45",
          +       "locale": null,
          +       "phonenumber": null,
                },
              },
              "entity-type": "user",
              "extendedGroups": Array [],
              "id": "joe",
      
            50 |     });
            51 |     expect(statusCode).toBe(200);
          > 52 |     expect(body).toMatchObject(JOE_USERPROFILE);
               |                  ^
            53 |   },
            54 | );
            55 | 
      
            at Object.toMatchObject (test/v1/user/user-enrichers.js:52:18)
      

      This is because the /default-domain/UserWorkspaces document doesn't exist initially, so the user workspace creation fails with a 404 and so does the user profile one.

      Let's:

      • Create the user workspace root before the test.
      • When possible, fail requests that don't return a 2XX status code during the setup/teardown phases. This should always be possible except for some cases, like when afterAll tries to delete a resource that has not been created by a test on purpose (unauthorized, conflict, etc.).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ataillefer Antoine Taillefer
                Reporter:
                ataillefer Antoine Taillefer
                Participants:
                Reviewers:
                Thomas Roger
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours
                  5h