Skip to content

Commit

Permalink
Initial spec test for controller
Browse files Browse the repository at this point in the history
  • Loading branch information
markdeluk committed Jan 1, 2024
1 parent 9ce1459 commit a2eb819
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions api/src/availability/availability.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { testDate } from '@mocks/data';
import { AvailabilityController } from './availability.controller';
import { AvailabilityService } from './availability.service';
import { TestBed } from '@automock/jest';
import { createMockAbility } from '@hkrecruitment/shared/abilities.spec';
import { Action } from '@hkrecruitment/shared';

describe('AvailabilityController', () => {
let controller: AvailabilityController;
let service: AvailabilityService;

/************* Test setup ************/

beforeAll(() => {
jest
.spyOn(global, 'Date')
.mockImplementation(() => testDate as unknown as string);
});

beforeEach(async () => {
const { unit, unitRef } = TestBed.create(AvailabilityController).compile();

controller = unit;
service = unitRef.get(AvailabilityService);
});

it('should be defined', () => {
expect(controller).toBeDefined();
expect(service).toBeDefined();
});
});

0 comments on commit a2eb819

Please sign in to comment.