trade360-nodejs-sdk
Version:
LSports Trade360 SDK for Node.js
78 lines • 5.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-env jest */
const prematch_snapshot_routes_prefix_url_1 = require("../../../../src/api/snapshot-api/enums/prematch-snapshot-routes-prefix-url");
describe('PrematchSnapshotApiClientPrefixUrl Enum', () => {
it('should have correct route values for all prematch endpoints', () => {
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_EVENTS_PREFIX_URL).toBe('/Prematch/GetEvents');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_FIXTURE_MARKETS_PREFIX_URL).toBe('/Prematch/GetFixtureMarkets');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_FIXTURES_PREFIX_URL).toBe('/Prematch/GetFixtures');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_SCORES_PREFIX_URL).toBe('/Prematch/GetScores');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_OUTRIGHT_EVENT_PREFIX_URL).toBe('/Prematch/GetOutrightEvents');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_OUTRIGHT_FIXTURE_PREFIX_URL).toBe('/Prematch/GetOutrightFixture');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_OUTRIGHT_LEAGUES_PREFIX_URL).toBe('/Prematch/GetOutrightLeagues');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_OUTRIGHT_LEAGUES_MARKETS_PREFIX_URL).toBe('/Prematch/GetOutrightLeagueMarkets');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_OUTRIGHT_LEAGUE_EVENTS_PREFIX_URL).toBe('/Prematch/GetOutrightLeagueEvents');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_OUTRIGHT_FIXTURE_MARKETS_PREFIX_URL).toBe('/Prematch/GetOutrightFixtureMarkets');
expect(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl.GET_OUTRIGHT_SCORES_PREFIX_URL).toBe('/Prematch/GetOutrightScores');
});
it('should contain all expected enum keys', () => {
const keys = Object.keys(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl);
expect(keys).toEqual([
'GET_EVENTS_PREFIX_URL',
'GET_FIXTURE_MARKETS_PREFIX_URL',
'GET_FIXTURES_PREFIX_URL',
'GET_SCORES_PREFIX_URL',
'GET_OUTRIGHT_EVENT_PREFIX_URL',
'GET_OUTRIGHT_FIXTURE_PREFIX_URL',
'GET_OUTRIGHT_LEAGUES_PREFIX_URL',
'GET_OUTRIGHT_LEAGUES_MARKETS_PREFIX_URL',
'GET_OUTRIGHT_LEAGUE_EVENTS_PREFIX_URL',
'GET_OUTRIGHT_FIXTURE_MARKETS_PREFIX_URL',
'GET_OUTRIGHT_SCORES_PREFIX_URL',
]);
});
it('should have 11 total endpoints (4 standard + 7 outright)', () => {
const keys = Object.keys(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl);
expect(keys).toHaveLength(11);
});
it('should contain all outright endpoint keys', () => {
const keys = Object.keys(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl);
const outrightKeys = keys.filter((key) => key.includes('OUTRIGHT'));
expect(outrightKeys).toHaveLength(7);
expect(outrightKeys).toEqual([
'GET_OUTRIGHT_EVENT_PREFIX_URL',
'GET_OUTRIGHT_FIXTURE_PREFIX_URL',
'GET_OUTRIGHT_LEAGUES_PREFIX_URL',
'GET_OUTRIGHT_LEAGUES_MARKETS_PREFIX_URL',
'GET_OUTRIGHT_LEAGUE_EVENTS_PREFIX_URL',
'GET_OUTRIGHT_FIXTURE_MARKETS_PREFIX_URL',
'GET_OUTRIGHT_SCORES_PREFIX_URL',
]);
});
it('should have all routes prefixed with /Prematch/', () => {
const values = Object.values(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl);
values.forEach((route) => {
expect(route).toMatch(/^\/Prematch\//);
});
});
it('should differentiate from inplay routes by using Prematch prefix', () => {
const values = Object.values(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl);
values.forEach((route) => {
expect(route).not.toMatch(/^\/Inplay\//);
expect(route).toMatch(/^\/Prematch\//);
});
});
it('should have unique route values', () => {
const values = Object.values(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl);
const uniqueValues = new Set(values);
expect(uniqueValues.size).toBe(values.length);
});
it('should maintain consistent naming pattern for outright endpoints', () => {
const outrightRoutes = Object.values(prematch_snapshot_routes_prefix_url_1.PrematchSnapshotApiClientPrefixUrl).filter((route) => route.includes('Outright'));
outrightRoutes.forEach((route) => {
expect(route).toMatch(/^\/Prematch\/GetOutright/);
});
});
});
//# sourceMappingURL=prematch-snapshot-routes-prefix-url.spec.js.map