Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m50s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import { describe, it, expect, beforeEach } from 'vitest';
|
|
import { LeaguesTestContext } from '../LeaguesTestContext';
|
|
|
|
describe('League Settings - Basic Info', () => {
|
|
let context: LeaguesTestContext;
|
|
|
|
beforeEach(() => {
|
|
context = new LeaguesTestContext();
|
|
context.clear();
|
|
});
|
|
|
|
it('should retrieve league basic information', async () => {
|
|
const league = await context.createLeague({
|
|
name: 'Test League',
|
|
description: 'Test Description',
|
|
visibility: 'public',
|
|
});
|
|
|
|
const result = await context.leagueRepository.findById(league.id);
|
|
|
|
expect(result).toBeDefined();
|
|
expect(result?.name).toBe('Test League');
|
|
expect(result?.description).toBe('Test Description');
|
|
expect(result?.visibility).toBe('public');
|
|
});
|
|
|
|
it('should update league basic information', async () => {
|
|
const league = await context.createLeague({ name: 'Old Name' });
|
|
|
|
await context.leagueRepository.update(league.id, { name: 'New Name', description: 'New Description' });
|
|
|
|
const updated = await context.leagueRepository.findById(league.id);
|
|
expect(updated?.name).toBe('New Name');
|
|
expect(updated?.description).toBe('New Description');
|
|
});
|
|
});
|