🎯 Simplify test code formatting and improve readability in useChallongeClient unit tests
This commit is contained in:
@@ -28,7 +28,9 @@ vi.mock('../../../src/composables/useChallongeClientCredentials.js', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('../../../src/services/challonge.service.js', async () => {
|
vi.mock('../../../src/services/challonge.service.js', async () => {
|
||||||
const actual = await vi.importActual('../../../src/services/challonge.service.js');
|
const actual = await vi.importActual(
|
||||||
|
'../../../src/services/challonge.service.js'
|
||||||
|
);
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
createChallongeV1Client: vi.fn(() => ({ version: 'v1', mock: true })),
|
createChallongeV1Client: vi.fn(() => ({ version: 'v1', mock: true })),
|
||||||
@@ -40,11 +42,7 @@ import { useChallongeClient } from '../../../src/composables/useChallongeClient.
|
|||||||
|
|
||||||
describe('useChallongeClient', () => {
|
describe('useChallongeClient', () => {
|
||||||
it('creates composable with default values', () => {
|
it('creates composable with default values', () => {
|
||||||
const {
|
const { apiVersion, tournamentScope, debugMode } = useChallongeClient();
|
||||||
apiVersion,
|
|
||||||
tournamentScope,
|
|
||||||
debugMode
|
|
||||||
} = useChallongeClient();
|
|
||||||
|
|
||||||
expect(apiVersion.value).toBe('v2.1');
|
expect(apiVersion.value).toBe('v2.1');
|
||||||
expect(tournamentScope.value).toBe(ScopeType.USER);
|
expect(tournamentScope.value).toBe(ScopeType.USER);
|
||||||
@@ -53,7 +51,7 @@ describe('useChallongeClient', () => {
|
|||||||
|
|
||||||
it('creates client successfully', () => {
|
it('creates client successfully', () => {
|
||||||
const { client } = useChallongeClient();
|
const { client } = useChallongeClient();
|
||||||
|
|
||||||
expect(client.value).toBeDefined();
|
expect(client.value).toBeDefined();
|
||||||
expect(client.value).toHaveProperty('version');
|
expect(client.value).toHaveProperty('version');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user