fix(analytics): specs

This commit is contained in:
Karol Sójko
2022-11-18 14:19:58 +01:00
parent be214c0599
commit 507d43b328
2 changed files with 12 additions and 12 deletions
@@ -14,7 +14,7 @@ describe('GetUserAnalyticsId', () => {
beforeEach(() => {
analyticsEntity = {
id: 123,
userUuid: '1-2-3',
userUuid: '84c0f8e8-544a-4c7e-9adf-26209303bc1d',
userEmail: '[email protected]',
} as jest.Mocked<AnalyticsEntity>
@@ -24,11 +24,11 @@ describe('GetUserAnalyticsId', () => {
})
it('should return analytics id for a user by uuid', async () => {
expect(await (await createUseCase().execute({ userUuid: '1-2-3' })).analyticsId).toEqual(123)
expect((await createUseCase().execute({ userUuid: '1-2-3' })).analyticsId).toEqual(123)
})
it('should return analytics id for a user by email', async () => {
expect(await (await createUseCase().execute({ userEmail: '[email protected]' })).analyticsId).toEqual(123)
expect((await createUseCase().execute({ userEmail: '[email protected]' })).analyticsId).toEqual(123)
})
it('should throw error if user is missing analytics entity', async () => {
@@ -46,7 +46,7 @@ describe('SaveRevenueModification', () => {
planName: SubscriptionPlanName.create('PRO_PLAN').getValue(),
subscriptionId: 1234,
userEmail: Email.create('[email protected]').getValue(),
userUuid: Uuid.create('1-2-3').getValue(),
userUuid: Uuid.create('84c0f8e8-544a-4c7e-9adf-26209303bc1d').getValue(),
})
expect(revenueOrError.isFailed()).toBeFalsy()
@@ -64,7 +64,7 @@ describe('SaveRevenueModification', () => {
planName: SubscriptionPlanName.create('PRO_PLAN').getValue(),
subscriptionId: 1234,
userEmail: Email.create('[email protected]').getValue(),
userUuid: Uuid.create('1-2-3').getValue(),
userUuid: Uuid.create('84c0f8e8-544a-4c7e-9adf-26209303bc1d').getValue(),
})
expect(revenueOrError.isFailed()).toBeFalsy()
@@ -82,7 +82,7 @@ describe('SaveRevenueModification', () => {
planName: SubscriptionPlanName.create('PRO_PLAN').getValue(),
subscriptionId: 1234,
userEmail: Email.create('[email protected]').getValue(),
userUuid: Uuid.create('1-2-3').getValue(),
userUuid: Uuid.create('84c0f8e8-544a-4c7e-9adf-26209303bc1d').getValue(),
})
expect(revenueOrError.isFailed()).toBeFalsy()
@@ -102,7 +102,7 @@ describe('SaveRevenueModification', () => {
planName: SubscriptionPlanName.create('PRO_PLAN').getValue(),
subscriptionId: 1234,
userEmail: Email.create('[email protected]').getValue(),
userUuid: Uuid.create('1-2-3').getValue(),
userUuid: Uuid.create('84c0f8e8-544a-4c7e-9adf-26209303bc1d').getValue(),
})
expect(revenueOrError.isFailed()).toBeFalsy()
@@ -123,7 +123,7 @@ describe('SaveRevenueModification', () => {
planName: SubscriptionPlanName.create('PRO_PLAN').getValue(),
subscriptionId: 1234,
userEmail: Email.create('[email protected]').getValue(),
userUuid: Uuid.create('1-2-3').getValue(),
userUuid: Uuid.create('84c0f8e8-544a-4c7e-9adf-26209303bc1d').getValue(),
})
expect(revenueOrError.isFailed()).toBeTruthy()
@@ -143,7 +143,7 @@ describe('SaveRevenueModification', () => {
planName: SubscriptionPlanName.create('PRO_PLAN').getValue(),
subscriptionId: 1234,
userEmail: Email.create('[email protected]').getValue(),
userUuid: Uuid.create('1-2-3').getValue(),
userUuid: Uuid.create('84c0f8e8-544a-4c7e-9adf-26209303bc1d').getValue(),
})
expect(revenueOrError.isFailed()).toBeTruthy()
@@ -163,7 +163,7 @@ describe('SaveRevenueModification', () => {
planName: SubscriptionPlanName.create('PRO_PLAN').getValue(),
subscriptionId: 1234,
userEmail: Email.create('[email protected]').getValue(),
userUuid: Uuid.create('1-2-3').getValue(),
userUuid: Uuid.create('84c0f8e8-544a-4c7e-9adf-26209303bc1d').getValue(),
})
expect(revenueOrError.isFailed()).toBeTruthy()
@@ -183,7 +183,7 @@ describe('SaveRevenueModification', () => {
planName: SubscriptionPlanName.create('PRO_PLAN').getValue(),
subscriptionId: 1234,
userEmail: Email.create('[email protected]').getValue(),
userUuid: Uuid.create('1-2-3').getValue(),
userUuid: Uuid.create('84c0f8e8-544a-4c7e-9adf-26209303bc1d').getValue(),
})
expect(revenueOrError.isFailed()).toBeTruthy()
@@ -203,7 +203,7 @@ describe('SaveRevenueModification', () => {
planName: SubscriptionPlanName.create('PRO_PLAN').getValue(),
subscriptionId: 1234,
userEmail: Email.create('[email protected]').getValue(),
userUuid: Uuid.create('1-2-3').getValue(),
userUuid: Uuid.create('84c0f8e8-544a-4c7e-9adf-26209303bc1d').getValue(),
})
expect(revenueOrError.isFailed()).toBeTruthy()