tests cleanup
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user