Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy INT PR #552

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Merge branch 'develop' into develop-INT

ece618d
Select commit
Loading
Failed to load commit list.
Open

deploy INT PR #552

Merge branch 'develop' into develop-INT
ece618d
Select commit
Loading
Failed to load commit list.
meemoo-jenkins / Jenkins failed Dec 31, 2024 in 2m 51s

Test code: error in 'sh' step

Test code / Shell Script

Error in sh step, with arguments #!/bin/bash npm ci --include=dev npm run test:ci .

script returned exit code 1
Build log
npm WARN deprecated [email protected]: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated [email protected]: Please upgrade to v7.0.2+ of superagent.  We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing.  See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.
npm WARN deprecated @types/[email protected]: This is a stub types definition. ioredis provides its own type definitions, so you do not need this installed.
npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.

> [email protected] prepare
> husky install

fatal: detected dubious ownership in repository at '/home/jenkins/agent/workspace/hetarchief-v3_proxy_PR-552'
To add an exception for this directory, call:

	git config --global --add safe.directory /home/jenkins/agent/workspace/hetarchief-v3_proxy_PR-552

added 1600 packages, and audited 1601 packages in 33s

217 packages are looking for funding
  run `npm fund` for details

42 vulnerabilities (5 low, 11 moderate, 23 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

> [email protected] test:ci
> npx jest --maxWorkers=1

FAIL src/modules/visits/controllers/visits.controller.spec.ts (5.851 s)
  ● VisitsController › getPersonalVisits › should return all visits for a user

    TypeError: Cannot read properties of undefined (reading 'name')

      20 | 		updatedByName: null,
      21 | 		createdAt: new Date().toISOString(),
    > 22 | 		spaceName: space.name,
         | 		                 ^
      23 | 		spaceMail: space.contactInfo.email,
      24 | 		spaceId: space.id,
      25 | 		spaceTelephone: space.contactInfo.telephone,

      at getFakeVisitorRequest (modules/visits/controllers/visits.controller.helpers.ts:22:20)
      at VisitsController.getPersonalVisits (modules/visits/controllers/visits.controller.ts:165:51)
      at Object.<anonymous> (modules/visits/controllers/visits.controller.spec.ts:299:19)

FAIL src/modules/campaign-monitor/services/campaign-monitor.service.spec.ts
  ● CampaignMonitorService › sendForMaterialRequest › should successfully send mail when emailInfo has valid fields

    expect(received).toBeUndefined()

    Received: [BadRequestException: {
      "message": "Failed to make request to campaign monitor api",
      "innerException": {
        "cause": {
          "errno": -3008,
          "code": "ENOTFOUND",
          "syscall": "getaddrinfo",
          "hostname": "campaignmonitor"
        }
      },
      "additionalInfo": {
        "path": "/transactional/smartemail/fakeTemplateId/send",
        "method": "POST",
        "data": {
          "to": [],
          "consentToTrack": "unchanged",
          "data": {
            "user_firstname": "mockFirstName",
            "user_lastname": "mockLastName",
            "request_list": [
              {
                "title": "Onderzoekscommissie PFAS-PFOS 03-12-2021, 08u5§",
                "cp_name": "VRT",
                "pid": "identifier",
                "page_url": "http://hetarchief.be/zoeken/vrt/identifier",
                "request_type": "Ik wil dit object hergebruiken",
                "request_description": "voor mijn onderzoek en studie"
              }
            ],
            "user_request_context": "Andere",
            "user_organisation": "Test Organisation",
            "user_email": "[email protected]"
          },
          "To": [
            "[email protected]"
          ],
          "BCC": []
        }
      }
    }]

      345 | 				await campaignMonitorService.sendForMaterialRequest(materialRequestEmailInfo);
      346 | 			} catch (err) {
    > 347 | 				expect(err).toBeUndefined();
          | 				            ^
      348 | 			}
      349 | 		});
      350 |

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:347:17)

  ● CampaignMonitorService › convertPreferencesToNewsletterTemplateData › should parse preferences to newsletterTemplateData

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
    -   "Clear": false,
    +   "Clear": true,
        "Key": "created_date",
        "Value": null,
      }

      403 | 				mockNewsletterTemplateDataWithNewsletter.CustomFields[3]
      404 | 			);
    > 405 | 			expect(result.CustomFields[4]).toEqual(
          | 			                               ^
      406 | 				mockNewsletterTemplateDataWithNewsletter.CustomFields[4]
      407 | 			);
      408 | 			expect(result.CustomFields[5]).toEqual(

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:405:35)

  ● CampaignMonitorService › convertPreferencesToNewsletterTemplateData › should parse preferences to newsletterTemplateData

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
    -   "Clear": false,
    +   "Clear": true,
        "Key": "created_date",
        "Value": null,
      }

      444 | 				mockNewsletterTemplateDataWithNewsletter.CustomFields[3]
      445 | 			);
    > 446 | 			expect(result.CustomFields[4]).toEqual(
          | 			                               ^
      447 | 				mockNewsletterTemplateDataWithNewsletter.CustomFields[4]
      448 | 			);
      449 | 			expect(result.CustomFields[5]).toEqual(

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:446:35)

  ● CampaignMonitorService › fetchNewsletterPreferences › should return newsletter = true when optin_mail_lists contains "newsletter"

    expect(received).toEqual(expected) // deep equality

    Expected: {"newsletter": true}
    Received: undefined

      483 | 				});
      484 | 			const result = await campaignMonitorService.fetchNewsletterPreferences(mockUser.email);
    > 485 | 			expect(result).toEqual({ newsletter: true });
          | 			               ^
      486 | 		});
      487 |
      488 | 		it('should return newsletter = false when errorcode 203 is returned', async () => {

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:485:19)

  ● CampaignMonitorService › fetchNewsletterPreferences › should return newsletter = false when errorcode 203 is returned

    expect(received).toEqual(expected) // deep equality

    Expected: {"newsletter": false}
    Received: undefined

      501 | 				});
      502 | 			const result = await campaignMonitorService.fetchNewsletterPreferences(mockUser.email);
    > 503 | 			expect(result).toEqual({ newsletter: false });
          | 			               ^
      504 | 		});
      505 |
      506 | 		it('should throw error when CM throws error other than 203', async () => {

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:503:19)

  ● CampaignMonitorService › updateNewsletterPreferences › should succesfully update newsletterPrefferences when newsletter is true

    expect(received).toBeUndefined()

    Received: [InternalServerErrorException: Failed to update newsletter preferences]

      607 | 				});
      608 | 			} catch (e) {
    > 609 | 				expect(e).toBeUndefined();
          | 				          ^
      610 | 			}
      611 | 		});
      612 |

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:609:15)

  ● CampaignMonitorService › confirmEmail › should update newsletter preferences when token and email match

    expect(received).toBeUndefined()

    Received: [InternalServerErrorException: Failed to update newsletter preferences]

      722 | 				await campaignMonitorService.confirmEmail(mockSendMailQueryDto);
      723 | 			} catch (err) {
    > 724 | 				expect(err).toBeUndefined();
          | 				            ^
      725 | 			}
      726 | 		});
      727 | 	});

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:724:17)

PASS src/modules/visits/services/visits.service.spec.ts
PASS src/modules/ie-objects/elasticsearch/queryBuilder.spec.ts
PASS src/modules/notifications/services/notifications.service.spec.ts
PASS src/modules/ie-objects/helpers/limit-access-to-object-details.spec.ts
PASS src/modules/spaces/services/spaces.service.spec.ts
PASS src/modules/folders/services/folders.service.spec.ts
PASS src/modules/folders/controllers/folders.controller.spec.ts
PASS src/modules/auth/controllers/het-archief.controller.spec.ts
PASS src/modules/ie-objects/services/ie-objects.service.spec.ts
PASS src/modules/ie-objects/controllers/ie-objects.controller.spec.ts
PASS src/modules/material-requests/services/material-requests.service.spec.ts
PASS src/modules/spaces/controllers/spaces.controller.spec.ts
PASS src/modules/notifications/controllers/notifications.controller.spec.ts
PASS src/shared/auth/session-helper.spec.ts
FAIL src/modules/auth/controllers/auth.controller.spec.ts
  ● AuthController › should be defined

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › checkLogin › should return login info for a valid session and failed campaign monitor call

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › checkLogin › should return login info for a valid session and successful campaign monitor call

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › checkLogin › should return login info for a valid session and not call campaign monitor if lastAccessAt is today

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › checkLogin › should return the logged out message for an invalid session

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › global-logout › should return to an IDP-specific logout page if possible

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › global-logout › should logout and return to the returnUrl if no specific logout page is set

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

PASS src/modules/sitemap/services/sitemap.service.spec.ts
PASS src/modules/material-requests/controllers/material-requests.controller.spec.ts
PASS src/modules/auth/services/idp.service.spec.ts
FAIL src/modules/users/services/users.service.spec.ts
  ● UsersService › getUserByIdentityId › should get a user by identity id

    InternalServerErrorException: Failed to get data from database, check the logs for more information.

      145 |
      146 | 	public async getUserByIdentityId(identityId: string): Promise<User | null> {
    > 147 | 		const userResponse = await this.dataService.execute<
          | 		                     ^
      148 | 			GetUserByIdentityIdQuery,
      149 | 			GetUserByIdentityIdQueryVariables
      150 | 		>(GetUserByIdentityIdDocument, {

      at DataService.execute (../node_modules/@meemoo/admin-core-api/src/modules/data/services/data.service.ts:101:10)
      at UsersService.getUserByIdentityId (modules/users/services/users.service.ts:147:24)
      at Object.<anonymous> (modules/users/services/users.service.spec.ts:97:19)

  ● UsersService › getUserByIdentityId › throws a notfoundexception if the user was not found

    InternalServerErrorException: Failed to get data from database, check the logs for more information.

      145 |
      146 | 	public async getUserByIdentityId(identityId: string): Promise<User | null> {
    > 147 | 		const userResponse = await this.dataService.execute<
          | 		                     ^
      148 | 			GetUserByIdentityIdQuery,
      149 | 			GetUserByIdentityIdQueryVariables
      150 | 		>(GetUserByIdentityIdDocument, {

      at DataService.execute (../node_modules/@meemoo/admin-core-api/src/modules/data/services/data.service.ts:101:10)
      at UsersService.getUserByIdentityId (modules/users/services/users.service.ts:147:24)
      at Object.<anonymous> (modules/users/services/users.service.spec.ts:107:17)

  ● UsersService › createUserWithIdp › should create a user and link an IDP

    InternalServerErrorException: Failed to get data from database, check the logs for more information.

      172 | 			organisation_schema_identifier: createUserDto.organisationId,
      173 | 		};
    > 174 | 		const { insert_users_profile_one: createdUser } = await this.dataService.execute<
          | 		                                                  ^
      175 | 			InsertUserMutation,
      176 | 			InsertUserMutationVariables
      177 | 		>(InsertUserDocument, { newUser });

      at DataService.execute (../node_modules/@meemoo/admin-core-api/src/modules/data/services/data.service.ts:101:10)
      at UsersService.createUserWithIdp (modules/users/services/users.service.ts:174:53)
      at Object.<anonymous> (modules/users/services/users.service.spec.ts:122:19)

  ● UsersService › updateUser › should update a user

    InternalServerErrorException: Failed to get data from database, check the logs for more information.

      212 | 		};
      213 |
    > 214 | 		const { update_users_profile: updatedUser } = await this.dataService.execute<
          | 		                                              ^
      215 | 			UpdateUserProfileMutation,
      216 | 			UpdateUserProfileMutationVariables
      217 | 		>(UpdateUserProfileDocument, {

      at DataService.execute (../node_modules/@meemoo/admin-core-api/src/modules/data/services/data.service.ts:101:10)
      at UsersService.updateUser (modules/users/services/users.service.ts:214:49)
      at Object.<anonymous> (modules/users/services/users.service.spec.ts:145:19)

  ● UsersService › updateAcceptedTos › should update if a user accepted the terms of service

    InternalServerErrorException: Failed to get data from database, check the logs for more information.

      245 | 		};
      246 |
    > 247 | 		const { update_users_profile: updatedUser } = await this.dataService.execute<
          | 		                                              ^
      248 | 			UpdateUserProfileMutation,
      249 | 			UpdateUserProfileMutationVariables
      250 | 		>(UpdateUserProfileDocument, {

      at DataService.execute (../node_modules/@meemoo/admin-core-api/src/modules/data/services/data.service.ts:101:10)
      at UsersService.updateAcceptedTos (modules/users/services/users.service.ts:247:49)
      at Object.<anonymous> (modules/users/services/users.service.spec.ts:163:19)

  ● UsersService › updateAcceptedTos › should throw a not found exception when the id is not of a existing user

    expect(received).toEqual(expected) // deep equality

    Expected: "User with id \"invalidId\" was not found"
    Received: "Failed to get data from database, check the logs for more information."

      177 | 				});
      178 | 			} catch (err) {
    > 179 | 				expect(err.message).toEqual('User with id "invalidId" was not found');
          | 				                    ^
      180 | 				expect(err.name).toEqual('NotFoundException');
      181 | 			}
      182 | 		});

      at Object.<anonymous> (modules/users/services/users.service.spec.ts:179:25)

  ● UsersService › updateLastAccessDate › should update a users last access date

    expect(received).toEqual(expected) // deep equality

    Expected: {"affectedRows": 1}
    Received: undefined

      192 |
      193 | 			const response = await usersService.updateLastAccessDate('user-123');
    > 194 | 			expect(response).toEqual({ affectedRows: 1 });
          | 			                 ^
      195 | 		});
      196 |
      197 | 		it('should catch and not throw an error', async () => {

      at Object.<anonymous> (modules/users/services/users.service.spec.ts:194:21)

FAIL src/modules/campaign-monitor/controllers/campaign-monitor.controller.spec.ts
  ● CampaignMonitorController › should be defined

    Nest can't resolve dependencies of the CampaignMonitorController (CampaignMonitorService, EventsService, ?). Please make sure that the argument UsersService at index [2] is available in the RootTestModule context.

    Potential solutions:
    - Is RootTestModule a valid NestJS module?
    - If UsersService is a provider, is it part of the current RootTestModule?
    - If UsersService is exported from a separate @Module, is that module imported within RootTestModule?
      @Module({
        imports: [ /* the Module containing UsersService */ ]
      })

      45 | 		process.env.CLIENT_HOST = 'fakeClientHost';
      46 |
    > 47 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      48 | 			controllers: [CampaignMonitorController],
      49 | 			imports: [],
      50 | 			providers: [

      at TestingInjector.lookupComponentInParentModules (../node_modules/@nestjs/core/injector/injector.js:247:19)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/core/injector/injector.js:200:33)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/testing/testing-injector.js:19:45)
      at resolveParam (../node_modules/@nestjs/core/injector/injector.js:120:38)
          at async Promise.all (index 2)
      at TestingInjector.resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:135:27)
      at TestingInjector.loadInstance (../node_modules/@nestjs/core/injector/injector.js:61:13)
      at TestingInjector.loadController (../node_modules/@nestjs/core/injector/injector.js:79:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:68:13
          at async Promise.all (index 0)
      at TestingInstanceLoader.createInstancesOfControllers (../node_modules/@nestjs/core/injector/instance-loader.js:67:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:42:13
          at async Promise.all (index 1)
      at TestingInstanceLoader.createInstances (../node_modules/@nestjs/core/injector/instance-loader.js:39:9)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/core/injector/instance-loader.js:22:13)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-instance-loader.js:9:9)
      at TestingModuleBuilder.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-module.builder.js:97:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:63:9)
      at Object.<anonymous> (modules/campaign-monitor/controllers/campaign-monitor.controller.spec.ts:47:33)

  ● CampaignMonitorController › sendTransactionalMail › should send an email

    Nest can't resolve dependencies of the CampaignMonitorController (CampaignMonitorService, EventsService, ?). Please make sure that the argument UsersService at index [2] is available in the RootTestModule context.

    Potential solutions:
    - Is RootTestModule a valid NestJS module?
    - If UsersService is a provider, is it part of the current RootTestModule?
    - If UsersService is exported from a separate @Module, is that module imported within RootTestModule?
      @Module({
        imports: [ /* the Module containing UsersService */ ]
      })

      45 | 		process.env.CLIENT_HOST = 'fakeClientHost';
      46 |
    > 47 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      48 | 			controllers: [CampaignMonitorController],
      49 | 			imports: [],
      50 | 			providers: [

      at TestingInjector.lookupComponentInParentModules (../node_modules/@nestjs/core/injector/injector.js:247:19)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/core/injector/injector.js:200:33)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/testing/testing-injector.js:19:45)
      at resolveParam (../node_modules/@nestjs/core/injector/injector.js:120:38)
          at async Promise.all (index 2)
      at TestingInjector.resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:135:27)
      at TestingInjector.loadInstance (../node_modules/@nestjs/core/injector/injector.js:61:13)
      at TestingInjector.loadController (../node_modules/@nestjs/core/injector/injector.js:79:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:68:13
          at async Promise.all (index 0)
      at TestingInstanceLoader.createInstancesOfControllers (../node_modules/@nestjs/core/injector/instance-loader.js:67:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:42:13
          at async Promise.all (index 1)
      at TestingInstanceLoader.createInstances (../node_modules/@nestjs/core/injector/instance-loader.js:39:9)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/core/injector/instance-loader.js:22:13)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-instance-loader.js:9:9)
      at TestingModuleBuilder.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-module.builder.js:97:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:63:9)
      at Object.<anonymous> (modules/campaign-monitor/controllers/campaign-monitor.controller.spec.ts:47:33)

  ● CampaignMonitorController › getPreferences › get user newsletter preferences

    Nest can't resolve dependencies of the CampaignMonitorController (CampaignMonitorService, EventsService, ?). Please make sure that the argument UsersService at index [2] is available in the RootTestModule context.

    Potential solutions:
    - Is RootTestModule a valid NestJS module?
    - If UsersService is a provider, is it part of the current RootTestModule?
    - If UsersService is exported from a separate @Module, is that module imported within RootTestModule?
      @Module({
        imports: [ /* the Module containing UsersService */ ]
      })

      45 | 		process.env.CLIENT_HOST = 'fakeClientHost';
      46 |
    > 47 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      48 | 			controllers: [CampaignMonitorController],
      49 | 			imports: [],
      50 | 			providers: [

      at TestingInjector.lookupComponentInParentModules (../node_modules/@nestjs/core/injector/injector.js:247:19)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/core/injector/injector.js:200:33)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/testing/testing-injector.js:19:45)
      at resolveParam (../node_modules/@nestjs/core/injector/injector.js:120:38)
          at async Promise.all (index 2)
      at TestingInjector.resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:135:27)
      at TestingInjector.loadInstance (../node_modules/@nestjs/core/injector/injector.js:61:13)
      at TestingInjector.loadController (../node_modules/@nestjs/core/injector/injector.js:79:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:68:13
          at async Promise.all (index 0)
      at TestingInstanceLoader.createInstancesOfControllers (../node_modules/@nestjs/core/injector/instance-loader.js:67:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:42:13
          at async Promise.all (index 1)
      at TestingInstanceLoader.createInstances (../node_modules/@nestjs/core/injector/instance-loader.js:39:9)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/core/injector/instance-loader.js:22:13)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-instance-loader.js:9:9)
      at TestingModuleBuilder.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-module.builder.js:97:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:63:9)
      at Object.<anonymous> (modules/campaign-monitor/controllers/campaign-monitor.controller.spec.ts:47:33)

  ● CampaignMonitorController › updatePreferences › update user newsletter preferences with logged in user

    Nest can't resolve dependencies of the CampaignMonitorController (CampaignMonitorService, EventsService, ?). Please make sure that the argument UsersService at index [2] is available in the RootTestModule context.

    Potential solutions:
    - Is RootTestModule a valid NestJS module?
    - If UsersService is a provider, is it part of the current RootTestModule?
    - If UsersService is exported from a separate @Module, is that module imported within RootTestModule?
      @Module({
        imports: [ /* the Module containing UsersService */ ]
      })

      45 | 		process.env.CLIENT_HOST = 'fakeClientHost';
      46 |
    > 47 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      48 | 			controllers: [CampaignMonitorController],
      49 | 			imports: [],
      50 | 			providers: [

      at TestingInjector.lookupComponentInParentModules (../node_modules/@nestjs/core/injector/injector.js:247:19)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/core/injector/injector.js:200:33)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/testing/testing-injector.js:19:45)
      at resolveParam (../node_modules/@nestjs/core/injector/injector.js:120:38)
          at async Promise.all (index 2)
      at TestingInjector.resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:135:27)
      at TestingInjector.loadInstance (../node_modules/@nestjs/core/injector/injector.js:61:13)
      at TestingInjector.loadController (../node_modules/@nestjs/core/injector/injector.js:79:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:68:13
          at async Promise.all (index 0)
      at TestingInstanceLoader.createInstancesOfControllers (../node_modules/@nestjs/core/injector/instance-loader.js:67:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:42:13
          at async Promise.all (index 1)
      at TestingInstanceLoader.createInstances (../node_modules/@nestjs/core/injector/instance-loader.js:39:9)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/core/injector/instance-loader.js:22:13)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-instance-loader.js:9:9)
      at TestingModuleBuilder.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-module.builder.js:97:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:63:9)
      at Object.<anonymous> (modules/campaign-monitor/controllers/campaign-monitor.controller.spec.ts:47:33)

  ● CampaignMonitorController › updatePreferences › sent confirmation mail when no user is logged in

    Nest can't resolve dependencies of the CampaignMonitorController (CampaignMonitorService, EventsService, ?). Please make sure that the argument UsersService at index [2] is available in the RootTestModule context.

    Potential solutions:
    - Is RootTestModule a valid NestJS module?
    - If UsersService is a provider, is it part of the current RootTestModule?
    - If UsersService is exported from a separate @Module, is that module imported within RootTestModule?
      @Module({
        imports: [ /* the Module containing UsersService */ ]
      })

      45 | 		process.env.CLIENT_HOST = 'fakeClientHost';
      46 |
    > 47 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      48 | 			controllers: [CampaignMonitorController],
      49 | 			imports: [],
      50 | 			providers: [

      at TestingInjector.lookupComponentInParentModules (../node_modules/@nestjs/core/injector/injector.js:247:19)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/core/injector/injector.js:200:33)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/testing/testing-injector.js:19:45)
      at resolveParam (../node_modules/@nestjs/core/injector/injector.js:120:38)
          at async Promise.all (index 2)
      at TestingInjector.resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:135:27)
      at TestingInjector.loadInstance (../node_modules/@nestjs/core/injector/injector.js:61:13)
      at TestingInjector.loadController (../node_modules/@nestjs/core/injector/injector.js:79:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:68:13
          at async Promise.all (index 0)
      at TestingInstanceLoader.createInstancesOfControllers (../node_modules/@nestjs/core/injector/instance-loader.js:67:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:42:13
          at async Promise.all (index 1)
      at TestingInstanceLoader.createInstances (../node_modules/@nestjs/core/injector/instance-loader.js:39:9)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/core/injector/instance-loader.js:22:13)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-instance-loader.js:9:9)
      at TestingModuleBuilder.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-module.builder.js:97:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:63:9)
      at Object.<anonymous> (modules/campaign-monitor/controllers/campaign-monitor.controller.spec.ts:47:33)

  ● CampaignMonitorController › confirmMail › redirect to nieuwsbrief/bevestiging when the token is valid

    Nest can't resolve dependencies of the CampaignMonitorController (CampaignMonitorService, EventsService, ?). Please make sure that the argument UsersService at index [2] is available in the RootTestModule context.

    Potential solutions:
    - Is RootTestModule a valid NestJS module?
    - If UsersService is a provider, is it part of the current RootTestModule?
    - If UsersService is exported from a separate @Module, is that module imported within RootTestModule?
      @Module({
        imports: [ /* the Module containing UsersService */ ]
      })

      45 | 		process.env.CLIENT_HOST = 'fakeClientHost';
      46 |
    > 47 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      48 | 			controllers: [CampaignMonitorController],
      49 | 			imports: [],
      50 | 			providers: [

      at TestingInjector.lookupComponentInParentModules (../node_modules/@nestjs/core/injector/injector.js:247:19)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/core/injector/injector.js:200:33)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/testing/testing-injector.js:19:45)
      at resolveParam (../node_modules/@nestjs/core/injector/injector.js:120:38)
          at async Promise.all (index 2)
      at TestingInjector.resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:135:27)
      at TestingInjector.loadInstance (../node_modules/@nestjs/core/injector/injector.js:61:13)
      at TestingInjector.loadController (../node_modules/@nestjs/core/injector/injector.js:79:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:68:13
          at async Promise.all (index 0)
      at TestingInstanceLoader.createInstancesOfControllers (../node_modules/@nestjs/core/injector/instance-loader.js:67:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:42:13
          at async Promise.all (index 1)
      at TestingInstanceLoader.createInstances (../node_modules/@nestjs/core/injector/instance-loader.js:39:9)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/core/injector/instance-loader.js:22:13)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-instance-loader.js:9:9)
      at TestingModuleBuilder.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-module.builder.js:97:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:63:9)
      at Object.<anonymous> (modules/campaign-monitor/controllers/campaign-monitor.controller.spec.ts:47:33)

  ● CampaignMonitorController › confirmMail › redirect to nieuwsbrief/mislukt when the token is invalid

    Nest can't resolve dependencies of the CampaignMonitorController (CampaignMonitorService, EventsService, ?). Please make sure that the argument UsersService at index [2] is available in the RootTestModule context.

    Potential solutions:
    - Is RootTestModule a valid NestJS module?
    - If UsersService is a provider, is it part of the current RootTestModule?
    - If UsersService is exported from a separate @Module, is that module imported within RootTestModule?
      @Module({
        imports: [ /* the Module containing UsersService */ ]
      })

      45 | 		process.env.CLIENT_HOST = 'fakeClientHost';
      46 |
    > 47 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      48 | 			controllers: [CampaignMonitorController],
      49 | 			imports: [],
      50 | 			providers: [

      at TestingInjector.lookupComponentInParentModules (../node_modules/@nestjs/core/injector/injector.js:247:19)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/core/injector/injector.js:200:33)
      at TestingInjector.resolveComponentInstance (../node_modules/@nestjs/testing/testing-injector.js:19:45)
      at resolveParam (../node_modules/@nestjs/core/injector/injector.js:120:38)
          at async Promise.all (index 2)
      at TestingInjector.resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:135:27)
      at TestingInjector.loadInstance (../node_modules/@nestjs/core/injector/injector.js:61:13)
      at TestingInjector.loadController (../node_modules/@nestjs/core/injector/injector.js:79:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:68:13
          at async Promise.all (index 0)
      at TestingInstanceLoader.createInstancesOfControllers (../node_modules/@nestjs/core/injector/instance-loader.js:67:9)
      at ../node_modules/@nestjs/core/injector/instance-loader.js:42:13
          at async Promise.all (index 1)
      at TestingInstanceLoader.createInstances (../node_modules/@nestjs/core/injector/instance-loader.js:39:9)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/core/injector/instance-loader.js:22:13)
      at TestingInstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-instance-loader.js:9:9)
      at TestingModuleBuilder.createInstancesOfDependencies (../node_modules/@nestjs/testing/testing-module.builder.js:97:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:63:9)
      at Object.<anonymous> (modules/campaign-monitor/controllers/campaign-monitor.controller.spec.ts:47:33)

PASS src/modules/campaign-monitor/dto/campaign-monitor.dto.spec.ts
PASS src/modules/ie-objects/helpers/get-access-through.spec.ts
PASS src/shared/guards/permission.guard.spec.ts
PASS src/modules/status/services/status.service.spec.ts
PASS src/modules/ie-objects/helpers/convert-node-to-es-query-filter-objects.spec.ts
PASS src/modules/organisations/services/organisations.service.spec.ts
PASS src/modules/content-partners/services/content-partners.service.spec.ts
PASS src/modules/organisations/controllers/organisations.controller.spec.ts
PASS src/modules/ie-objects/helpers/convert-objects-to-csv.spec.ts
PASS src/shared/guards/api-key.guard.spec.ts
PASS src/modules/events/controllers/events.controller.spec.ts
PASS src/modules/sitemap/controllers/sitemap.controller.spec.ts
PASS src/modules/tos/services/tos.service.spec.ts
PASS src/shared/services/session.service.spec.ts
PASS src/modules/not-found/controllers/not-found.controller.spec.ts
PASS src/modules/events/services/events.service.spec.ts
PASS src/modules/ie-objects/helpers/encode-search-term.spec.ts
PASS src/modules/ie-objects/helpers/convert-string-to-search-terms.spec.ts
PASS src/modules/ie-objects/helpers/get-sectors-with-essence-access.spec.ts
PASS src/modules/content-partners/controllers/content-partners.controller.spec.ts
PASS src/modules/newspapers/services/newspapers.service.spec.ts
PASS src/modules/status/controllers/status.controller.spec.ts
FAIL src/modules/users/controllers/users.controller.spec.ts
  ● UsersController › updateTos › should update if the user accepted the terms of service

    InternalServerErrorException: Failed to get data from database, check the logs for more information.

      245 | 		};
      246 |
    > 247 | 		const { update_users_profile: updatedUser } = await this.dataService.execute<
          | 		                                              ^
      248 | 			UpdateUserProfileMutation,
      249 | 			UpdateUserProfileMutationVariables
      250 | 		>(UpdateUserProfileDocument, {

      at DataService.execute (../node_modules/@meemoo/admin-core-api/src/modules/data/services/data.service.ts:101:10)
      at UsersService.updateAcceptedTos (modules/users/services/users.service.ts:247:49)
      at UsersController.updateTos (modules/users/controllers/users.controller.ts:64:16)
      at Object.<anonymous> (modules/users/controllers/users.controller.spec.ts:53:17)

PASS src/modules/newspapers/controllers/newspapers.controller.spec.ts
PASS src/modules/visits/dto/visits.dto.spec.ts
PASS src/shared/helpers/comma-separated-string-to-array.spec.ts
PASS src/modules/auth/services/het-archief.service.spec.ts
PASS src/modules/tos/controllers/tos.controller.spec.ts
PASS src/modules/ie-objects/helpers/convert-objects-to-xml.spec.ts
PASS src/modules/campaign-monitor/helpers/crypto-helper.spec.ts
PASS src/modules/material-requests/dto/material-requests.dto.spec.ts
PASS src/modules/ie-objects/helpers/check-and-fix-format-filter.spec.ts
PASS src/modules/ie-objects/dto/ie-objects.dto.spec.ts
PASS src/config/__tests__/config.spec.ts
PASS src/modules/ie-objects/helpers/convert-query-to-literal-string.spec.ts
PASS src/shared/guards/logged-in.guard.spec.ts
PASS src/modules/users/dto/users.dto.spec.ts
PASS src/modules/folders/dto/folders.dto.spec.ts
PASS src/modules/spaces/dto/spaces.dto.spec.ts
PASS src/shared/helpers/events.spec.ts
PASS src/shared/helpers/format-belgian-date.spec.ts
PASS src/shared/helpers/pagination.spec.ts
PASS src/modules/content-partners/dto/content-partners.dto.spec.ts
PASS src/modules/notifications/dto/notifications.dto.spec.ts

Summary of all failing tests
FAIL modules/visits/controllers/visits.controller.spec.ts (5.851 s)
  ● VisitsController › getPersonalVisits › should return all visits for a user

    TypeError: Cannot read properties of undefined (reading 'name')

      20 | 		updatedByName: null,
      21 | 		createdAt: new Date().toISOString(),
    > 22 | 		spaceName: space.name,
         | 		                 ^
      23 | 		spaceMail: space.contactInfo.email,
      24 | 		spaceId: space.id,
      25 | 		spaceTelephone: space.contactInfo.telephone,

      at getFakeVisitorRequest (modules/visits/controllers/visits.controller.helpers.ts:22:20)
      at VisitsController.getPersonalVisits (modules/visits/controllers/visits.controller.ts:165:51)
      at Object.<anonymous> (modules/visits/controllers/visits.controller.spec.ts:299:19)

FAIL modules/campaign-monitor/services/campaign-monitor.service.spec.ts
  ● CampaignMonitorService › sendForMaterialRequest › should successfully send mail when emailInfo has valid fields

    expect(received).toBeUndefined()

    Received: [BadRequestException: {
      "message": "Failed to make request to campaign monitor api",
      "innerException": {
        "cause": {
          "errno": -3008,
          "code": "ENOTFOUND",
          "syscall": "getaddrinfo",
          "hostname": "campaignmonitor"
        }
      },
      "additionalInfo": {
        "path": "/transactional/smartemail/fakeTemplateId/send",
        "method": "POST",
        "data": {
          "to": [],
          "consentToTrack": "unchanged",
          "data": {
            "user_firstname": "mockFirstName",
            "user_lastname": "mockLastName",
            "request_list": [
              {
                "title": "Onderzoekscommissie PFAS-PFOS 03-12-2021, 08u5§",
                "cp_name": "VRT",
                "pid": "identifier",
                "page_url": "http://hetarchief.be/zoeken/vrt/identifier",
                "request_type": "Ik wil dit object hergebruiken",
                "request_description": "voor mijn onderzoek en studie"
              }
            ],
            "user_request_context": "Andere",
            "user_organisation": "Test Organisation",
            "user_email": "[email protected]"
          },
          "To": [
            "[email protected]"
          ],
          "BCC": []
        }
      }
    }]

      345 | 				await campaignMonitorService.sendForMaterialRequest(materialRequestEmailInfo);
      346 | 			} catch (err) {
    > 347 | 				expect(err).toBeUndefined();
          | 				            ^
      348 | 			}
      349 | 		});
      350 |

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:347:17)

  ● CampaignMonitorService › convertPreferencesToNewsletterTemplateData › should parse preferences to newsletterTemplateData

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
    -   "Clear": false,
    +   "Clear": true,
        "Key": "created_date",
        "Value": null,
      }

      403 | 				mockNewsletterTemplateDataWithNewsletter.CustomFields[3]
      404 | 			);
    > 405 | 			expect(result.CustomFields[4]).toEqual(
          | 			                               ^
      406 | 				mockNewsletterTemplateDataWithNewsletter.CustomFields[4]
      407 | 			);
      408 | 			expect(result.CustomFields[5]).toEqual(

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:405:35)

  ● CampaignMonitorService › convertPreferencesToNewsletterTemplateData › should parse preferences to newsletterTemplateData

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
    -   "Clear": false,
    +   "Clear": true,
        "Key": "created_date",
        "Value": null,
      }

      444 | 				mockNewsletterTemplateDataWithNewsletter.CustomFields[3]
      445 | 			);
    > 446 | 			expect(result.CustomFields[4]).toEqual(
          | 			                               ^
      447 | 				mockNewsletterTemplateDataWithNewsletter.CustomFields[4]
      448 | 			);
      449 | 			expect(result.CustomFields[5]).toEqual(

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:446:35)

  ● CampaignMonitorService › fetchNewsletterPreferences › should return newsletter = true when optin_mail_lists contains "newsletter"

    expect(received).toEqual(expected) // deep equality

    Expected: {"newsletter": true}
    Received: undefined

      483 | 				});
      484 | 			const result = await campaignMonitorService.fetchNewsletterPreferences(mockUser.email);
    > 485 | 			expect(result).toEqual({ newsletter: true });
          | 			               ^
      486 | 		});
      487 |
      488 | 		it('should return newsletter = false when errorcode 203 is returned', async () => {

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:485:19)

  ● CampaignMonitorService › fetchNewsletterPreferences › should return newsletter = false when errorcode 203 is returned

    expect(received).toEqual(expected) // deep equality

    Expected: {"newsletter": false}
    Received: undefined

      501 | 				});
      502 | 			const result = await campaignMonitorService.fetchNewsletterPreferences(mockUser.email);
    > 503 | 			expect(result).toEqual({ newsletter: false });
          | 			               ^
      504 | 		});
      505 |
      506 | 		it('should throw error when CM throws error other than 203', async () => {

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:503:19)

  ● CampaignMonitorService › updateNewsletterPreferences › should succesfully update newsletterPrefferences when newsletter is true

    expect(received).toBeUndefined()

    Received: [InternalServerErrorException: Failed to update newsletter preferences]

      607 | 				});
      608 | 			} catch (e) {
    > 609 | 				expect(e).toBeUndefined();
          | 				          ^
      610 | 			}
      611 | 		});
      612 |

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:609:15)

  ● CampaignMonitorService › confirmEmail › should update newsletter preferences when token and email match

    expect(received).toBeUndefined()

    Received: [InternalServerErrorException: Failed to update newsletter preferences]

      722 | 				await campaignMonitorService.confirmEmail(mockSendMailQueryDto);
      723 | 			} catch (err) {
    > 724 | 				expect(err).toBeUndefined();
          | 				            ^
      725 | 			}
      726 | 		});
      727 | 	});

      at Object.<anonymous> (modules/campaign-monitor/services/campaign-monitor.service.spec.ts:724:17)

FAIL modules/auth/controllers/auth.controller.spec.ts
  ● AuthController › should be defined

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › checkLogin › should return login info for a valid session and failed campaign monitor call

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › checkLogin › should return login info for a valid session and successful campaign monitor call

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › checkLogin › should return login info for a valid session and not call campaign monitor if lastAccessAt is today

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › checkLogin › should return the logged out message for an invalid session

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › global-logout › should return to an IDP-specific logout page if possible

    Nest cannot create the CampaignMonitorModule instance.
    The module at index [3] of the CampaignMonitorModule "imports" array is undefined.

    Potential causes:
    - A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
    - The module at index [3] is of type "undefined". Check your import statements and the type of the module.

    Scope [RootTestModule -> UsersModule]

      76 |
      77 | 	beforeEach(async () => {
    > 78 | 		const module: TestingModule = await Test.createTestingModule({
         | 		                              ^
      79 | 			controllers: [AuthController],
      80 | 			imports: [ConfigModule, SpacesModule, UsersModule],
      81 | 			providers: [

      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:53:23)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scanForModules (../node_modules/@nestjs/core/scanner.js:61:32)
      at DependenciesScanner.scan (../node_modules/@nestjs/core/scanner.js:27:9)
      at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:61:9)
      at Object.<anonymous> (modules/auth/controllers/auth.controller.spec.ts:78:33)

  ● AuthController › global-logout › should logout and return to the returnUrl if no specific logout page is set

    Nest cannot create the CampaignMonitorModule instance.
Output truncated.

Details

  • Declarative: Checkout SCM (11 sec)
    • Calculate extra ENV vars (4.1 sec)
    • Test code (2 min 2 sec)
      Error: script returned exit code 1
    • Build code (1.7 sec)
    • Deploy INT (4.8 sec)
    • Deploy TST (3.3 sec)
    • Deploy QAS (3.4 sec)
    • Deploy PRD (3.9 sec)
    • Declarative: Post Actions (1.6 sec)