tests cleanup

This commit is contained in:
2026-01-03 18:46:36 +01:00
parent 540c0fcb7a
commit c589b3c3fe
17 changed files with 402 additions and 2812 deletions

View File

@@ -11,7 +11,6 @@ import { AuthorizationGuard } from '../auth/AuthorizationGuard';
import type { AuthorizationService } from '../auth/AuthorizationService';
import { FeatureAvailabilityGuard } from '../policy/FeatureAvailabilityGuard';
import type { PolicyService, PolicySnapshot } from '../policy/PolicyService';
import { createHttpContractHarness } from '../../shared/testing/httpContractHarness';
describe('LeagueController', () => {
let controller: LeagueController;
@@ -143,18 +142,21 @@ describe('LeagueController', () => {
transferLeagueOwnership: vi.fn(async () => ({ success: true })),
};
const harness = await createHttpContractHarness({
const module = await Test.createTestingModule({
controllers: [LeagueController],
providers: [{ provide: LeagueService, useValue: leagueService }],
});
}).compile();
const app = module.createNestApplication();
await app.init();
try {
await harness.http
await request(app.getHttpServer())
.post('/leagues/l1/transfer-ownership')
.send({ currentOwnerId: 'spoof', newOwnerId: 'o2' })
.expect(400);
} finally {
await harness.close();
await app.close();
}
});
});