Skip to content

Commit

Permalink
test: add business registeration number
Browse files Browse the repository at this point in the history
  • Loading branch information
raipen committed Nov 18, 2023
1 parent bfb4cc0 commit b4186ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {
'!src/index.ts',
'!src/loaders/index.ts',
'!src/config/index.ts',
'!src/utils/sendSMS.ts',
],
moduleNameMapper: {
'^@api$': '<rootDir>/src/api',
Expand Down
16 changes: 14 additions & 2 deletions test/integration/0. init/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as User from '@DTO/user.dto';

export default (app: FastifyInstance) => () => {
const phone = '01012345678';
const businessRegistrationNumber = '1234567890';
const businessRegistrationNumber = '5133001104';
let tokenForCertificatePhone: string;
let certificatedPhoneToken: string;
let refreshToken: string;
Expand Down Expand Up @@ -70,7 +70,19 @@ export default (app: FastifyInstance) => () => {
expect(response.statusCode).toBe(401);
});

test('new user: fail', async () => {
test('new user: fail because of invalid businessRegistrationNumber', async () => {
const response = await app.inject({
method: 'POST',
url: '/api/user/login',
payload: {
businessRegistrationNumber: 'asdf',
certificatedPhoneToken: certificatedPhoneToken,
},
});
expect(response.statusCode).toBe(401);
});

test('new user: fail because of invalid certificatedPhoneToken', async () => {
const response = await app.inject({
method: 'POST',
url: '/api/user/login',
Expand Down

0 comments on commit b4186ab

Please sign in to comment.