Skip to content

Commit

Permalink
Add verification e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejkang committed Aug 25, 2021
1 parent 84d7be1 commit 5d8c0f5
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/verification.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import * as request from 'supertest';
import { AppModule } from './../src/app.module';

describe('DriverLicenseVerificationController (e2e)', () => {
let app: INestApplication;

beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();

app = moduleFixture.createNestApplication();
await app.init();
});

it('/verification (POST)', () => {
const configService = app.get(ConfigService);

return request(app.getHttpServer())
.post('/verification')
.send({
driverName: configService.get('TEST_DRIVER_NAME'),
driverBirthday: configService.get('TEST_DRIVER_BIRTHDAY'),
licenseNumber: configService.get('TEST_LICENSE_NUMBER'),
serialNumber: configService.get('TEST_SERIAL_NUMBER'),
})
.expect(200)
.expect({
isSuccess: true,
verificationResult: 'VALID',
});
});
});

0 comments on commit 5d8c0f5

Please sign in to comment.