diff --git a/.github/workflows/reusable-api-e2e.yml b/.github/workflows/reusable-api-e2e.yml index dbc6770309c..45f06209162 100644 --- a/.github/workflows/reusable-api-e2e.yml +++ b/.github/workflows/reusable-api-e2e.yml @@ -52,7 +52,6 @@ jobs: # This workflow contains a single job called "build" e2e_api: name: Test E2E - if: ${{ (contains(inputs.job-name, '-ee') && inputs.test-e2e-ee-affected) || (!contains(inputs.job-name, '-ee') && inputs.test-e2e-affected) }} runs-on: ubuntu-latest timeout-minutes: 80 permissions: diff --git a/apps/api/src/app/events/e2e/bulk-trigger.e2e.ts b/apps/api/src/app/events/e2e/bulk-trigger.e2e.ts index 4f12faa201f..5dfc9d0df20 100644 --- a/apps/api/src/app/events/e2e/bulk-trigger.e2e.ts +++ b/apps/api/src/app/events/e2e/bulk-trigger.e2e.ts @@ -99,7 +99,7 @@ describe('Trigger bulk events - /v1/events/trigger/bulk (POST) #novu-v2', functi expect(thirdEvent.transactionId).to.equal('3333'); }); - it('should gene?rate message and notification based on a bulk event', async function () { + it('should generate message and notification based on a bulk event', async function () { await novuClient.triggerBulk({ events: [ { diff --git a/apps/api/src/app/events/e2e/trigger-event.e2e.ts b/apps/api/src/app/events/e2e/trigger-event.e2e.ts index b21cf9146cf..e38ddcbc646 100644 --- a/apps/api/src/app/events/e2e/trigger-event.e2e.ts +++ b/apps/api/src/app/events/e2e/trigger-event.e2e.ts @@ -891,7 +891,6 @@ describe('Trigger event - /v1/events/trigger (POST) #novu-v2', function () { await session.awaitRunningJobs(); const envId = session.environment._id; - console.log(`created sub envId:${envId} subscriberId: ${subscriberId}`); const createdSubscriber = await subscriberRepository.findBySubscriberId(envId, subscriberId); expect(createdSubscriber?.subscriberId).to.equal(subscriberId); diff --git a/apps/api/src/app/shared/helpers/e2e/sdk/e2e-sdk.helper.ts b/apps/api/src/app/shared/helpers/e2e/sdk/e2e-sdk.helper.ts index f9a97fa250e..ff2dbe45790 100644 --- a/apps/api/src/app/shared/helpers/e2e/sdk/e2e-sdk.helper.ts +++ b/apps/api/src/app/shared/helpers/e2e/sdk/e2e-sdk.helper.ts @@ -4,12 +4,11 @@ import { UserSession } from '@novu/testing'; import { expect } from 'chai'; import { ErrorDto, ValidationErrorDto } from '@novu/api/models/errors'; -export function initNovuClassSdk(session: UserSession, overrideApiKey?: string): Novu { - return new Novu({ apiKey: session.apiKey, serverURL: session.serverUrl, debugLogger: console }); - // return new Novu({ apiKey: overrideApiKey || session.apiKey, serverURL: session.serverUrl }); +export function initNovuClassSdk(session: UserSession): Novu { + return new Novu({ apiKey: session.apiKey, serverURL: session.serverUrl }); } export function initNovuFunctionSdk(session: UserSession): NovuCore { - return new NovuCore({ apiKey: session.apiKey, serverURL: session.serverUrl, debugLogger: console }); + return new NovuCore({ apiKey: session.apiKey, serverURL: session.serverUrl }); } function isErrorDto(error: unknown): error is ErrorDto { diff --git a/apps/api/src/app/subscribers/e2e/update-global-preference.e2e.ts b/apps/api/src/app/subscribers/e2e/update-global-preference.e2e.ts index f5da9c9a3a7..3870c9ca583 100644 --- a/apps/api/src/app/subscribers/e2e/update-global-preference.e2e.ts +++ b/apps/api/src/app/subscribers/e2e/update-global-preference.e2e.ts @@ -33,30 +33,7 @@ describe('Update Subscribers global preferences - /subscribers/:subscriberId/pre ); expect(firstResponse).to.not.be.ok; } catch (error) { - expect(error.toJSON()).to.have.include({ - status: 400, - name: 'AxiosError', - message: 'Request failed with status code 400', - }); - } - - const yetAnotherBadPayload = { - enabled: 'hello', - preferences: [{ type: ChannelTypeEnum.Email, enabled: true }], - }; - - try { - const secondResponse = await novuClient.subscribers.preferences.updateGlobal( - yetAnotherBadPayload as any, - session.subscriberId - ); - expect(secondResponse).to.not.be.ok; - } catch (error) { - expect(error.toJSON()).to.have.include({ - status: 400, - name: 'AxiosError', - message: 'Request failed with status code 400', - }); + expect(error.pretty()).to.contain('Expected array, received boolean'); } }); @@ -160,7 +137,8 @@ describe('Update Subscribers global preferences - /subscribers/:subscriberId/pre // get the subscriber preferences in prod environment session.apiKey = session.environment.apiKeys[0].key; - const getProdPreferencesResponse = await novuClient.subscribers.preferences.list(session.subscriberId); + const novuClientForProduction = initNovuClassSdk(session); + const getProdPreferencesResponse = await novuClientForProduction.subscribers.preferences.list(session.subscriberId); const prodPreferences = getProdPreferencesResponse.result; expect(prodPreferences.every((item) => !!item.preference.channels.inApp)).to.be.true; }); diff --git a/apps/api/src/app/tenant/e2e/create-tenant.e2e.ts b/apps/api/src/app/tenant/e2e/create-tenant.e2e.ts index cfb23a47255..4ce7e2ef302 100644 --- a/apps/api/src/app/tenant/e2e/create-tenant.e2e.ts +++ b/apps/api/src/app/tenant/e2e/create-tenant.e2e.ts @@ -10,7 +10,6 @@ function assertValidationMessages(e: AxiosError, field: string, msg1: if (!(e instanceof AxiosError)) { throw new Error(e); } - console.log(JSON.stringify(e.response?.data)); const messages = e.response?.data.errors[field].messages; expect(messages).to.be.an('array').that.includes(msg1); diff --git a/apps/api/src/app/topics/topics.controller.ts b/apps/api/src/app/topics/topics.controller.ts index 8200ac3fec3..19fd65b212a 100644 --- a/apps/api/src/app/topics/topics.controller.ts +++ b/apps/api/src/app/topics/topics.controller.ts @@ -178,8 +178,6 @@ export class TopicsController { @UserSession() user: UserSessionData, @Query() query?: FilterTopicsRequestDto ): Promise { - console.log(JSON.stringify(query)); - return await this.filterTopicsUseCase.execute( FilterTopicsCommand.create({ environmentId: user.environmentId,