Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fllorent0D committed Sep 20, 2023
1 parent 60dbe15 commit 032d7d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 5 additions & 2 deletions src/api/member/controllers/member.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,32 @@ import { EloMemberService } from '../../../services/members/elo-member.service';
import { PlayerCategory } from '../../../entity/tabt-input.interface';
import { MembersSearchIndexService } from '../../../services/members/members-search-index.service';
import { MemberCategoryService } from '../../../services/members/member-category.service';
import { NumericRankingService } from '../../../common/data-aftt/services/numeric-ranking.service';

jest.mock('../../../services/members/member.service');
jest.mock('../../../services/seasons/season.service');
jest.mock('../../../services/members/elo-member.service');
jest.mock('../../../services/members/members-search-index.service');
jest.mock('../../../services/members/member-category.service');

jest.mock('../../../common/data-aftt/services/numeric-ranking.service')
describe('MemberController', () => {
let controller: MemberController;
let service: MemberService;
let eloService: EloMemberService;
let seasonService: SeasonService;
let numericRankingService: NumericRankingService;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [MemberController],
providers: [MemberService, SeasonService, EloMemberService, MembersSearchIndexService, MemberCategoryService],
providers: [MemberService, SeasonService, EloMemberService, MembersSearchIndexService, MemberCategoryService, NumericRankingService],
}).compile();

controller = module.get<MemberController>(MemberController);
service = module.get<MemberService>(MemberService);
eloService = module.get<EloMemberService>(EloMemberService);
seasonService = module.get<SeasonService>(SeasonService);
numericRankingService = module.get<NumericRankingService>(NumericRankingService);
});

it('should be defined', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/member/controllers/member.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { SeasonService } from '../../../services/seasons/season.service';
import { MembersSearchIndexService } from '../../../services/members/members-search-index.service';
import { MemberCategoryService } from '../../../services/members/member-category.service';
import { getSimplifiedPlayerCategory } from '../helpers/player-category-helpers';
import { NumericRankingService } from 'src/common/data-aftt/services/numeric-ranking.service';
import { NumericRankingService } from '../../../common/data-aftt/services/numeric-ranking.service';

@ApiTags('Members')
@Controller({
Expand Down
9 changes: 4 additions & 5 deletions src/common/data-aftt/services/numeric-ranking.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Injectable } from "@nestjs/common";
import { DataAFTTMemberNumericRankingModel } from "../model/member-numeric-ranking.model";
import { COMPETITION_TYPE, NumericRankingDetailsV3, PLAYER_CATEGORY, WeeklyNumericPointsV3, WeeklyNumericRankingV4 } from "src/api/member/dto/member.dto";
import { SimplifiedPlayerCategory } from "src/api/member/helpers/player-category-helpers";
import { PlayerCategory } from "src/entity/tabt-input.interface";
import { CompetitionType, Gender, IndividualResult } from "@prisma/client";
import { COMPETITION_TYPE, NumericRankingDetailsV3, WeeklyNumericPointsV3, WeeklyNumericRankingV4 } from "../../../api/member/dto/member.dto";
import { SimplifiedPlayerCategory } from "../../../api/member/helpers/player-category-helpers";
import { PlayerCategory } from "../../../entity/tabt-input.interface";
import { CompetitionType, Gender } from "@prisma/client";
import { format } from "date-fns";
import { DataAFTTIndividualResultModel, IndividualResultWithOpponent } from "../model/individual-results.model";
import { IndividualMatchResult } from "src/entity/tabt-soap/TabTAPI_Port";

@Injectable()
export class NumericRankingService {
Expand Down

0 comments on commit 032d7d8

Please sign in to comment.