Skip to content

Commit

Permalink
fixed inconsistencies in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed May 20, 2024
1 parent a369278 commit 68546c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/auth/auth.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Test } from '@nestjs/testing';
import { AppModule } from '../app/app.module';
import { ValidationPipe } from '@nestjs/common';
import { AuthType } from '@prisma/client';
import { SHA256 } from 'crypto-js';
import { MailService } from '../mail/mail.service';
import { mockDeep } from 'jest-mock-extended';
import { MailModule } from '../mail/mail.module';
Expand Down Expand Up @@ -98,7 +97,6 @@ describe('Auth Controller Tests', () => {
await prisma.user.create({
data: {
email: '[email protected]',
password: SHA256('password').toString(),
isEmailVerified: true,
authType: AuthType.EMAIL,
},
Expand Down
13 changes: 5 additions & 8 deletions src/user/user.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('User Controller Tests', () => {
data: {
id: '1',
email: '[email protected]',
password: 'password',
name: 'John Doe',
isEmailVerified: true,
authType: AuthType.EMAIL,
Expand Down Expand Up @@ -124,7 +123,6 @@ describe('User Controller Tests', () => {
data: {
id: '2',
email: '[email protected]',
password: 'password',
name: 'Jane Doe',
isEmailVerified: true,
authType: AuthType.EMAIL,
Expand All @@ -135,15 +133,15 @@ describe('User Controller Tests', () => {
data: [
{
postedToId: '2',
raterUserId: '1',
postedById: '1',
professionalism: 5,
reliability: 5,
communication: 5,
comment: 'Something',
},
{
postedToId: '2',
raterUserId: '1',
postedById: '1',
professionalism: 5,
reliability: 5,
communication: 5,
Expand All @@ -154,7 +152,7 @@ describe('User Controller Tests', () => {
await prisma.rating.create({
data: {
postedToId: '1',
raterUserId: '2',
postedById: '2',
professionalism: 5,
reliability: 5,
communication: 5,
Expand Down Expand Up @@ -308,7 +306,7 @@ describe('User Controller Tests', () => {
});
expect(rating).toBeDefined();
expect(rating.postedToId).toBe('2');
expect(rating.raterUserId).toBe('1');
expect(rating.postedById).toBe('1');
expect(rating.professionalism).toBe(5);
expect(rating.reliability).toBe(5);
expect(rating.communication).toBe(5);
Expand Down Expand Up @@ -344,7 +342,7 @@ describe('User Controller Tests', () => {
});
expect(rating).toBeDefined();
expect(rating.postedToId).toBe('2');
expect(rating.raterUserId).toBe(null);
expect(rating.postedById).toBe(null);
expect(rating.professionalism).toBe(5);
expect(rating.reliability).toBe(5);
expect(rating.communication).toBe(5);
Expand Down Expand Up @@ -428,7 +426,6 @@ describe('User Controller Tests', () => {
data: {
id: '3',
email: '[email protected]',
password: 'password',
name: 'John',
isEmailVerified: true,
authType: AuthType.EMAIL,
Expand Down

0 comments on commit 68546c0

Please sign in to comment.