Skip to content

Commit 0db72ee

Browse files
Test
AI-Session-Id: e9b3e072-2ec0-428a-b108-9646c6de8629 AI-Tool: claude-code AI-Model: unknown
1 parent 5e68127 commit 0db72ee

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/sync/polling/fetchers/__tests__/configsFetcher.spec.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { ISplitChangesResponse } from '../../../../dtos/types';
22
import { convertConfigsResponseToDefinitionChangesResponse, IConfigsResponse } from '../configsFetcher';
33

4-
// TODO: complete input and output mocks
5-
const inputMock: IConfigsResponse = {
4+
const INPUT: IConfigsResponse = {
65
s: 100,
76
t: 200,
87
d: [{ 'name': 'SomeConfig1', 'defaultVariant': 'v2', 'variants': [{ 'name': 'v1', 'definition': { 'prop1': true, 'prop2': 123 } }, { 'name': 'v2', 'definition': { 'prop1': false, 'prop2': 456 } }], 'targeting': { 'conditions': [{ 'variant': 'v1', 'label': 'main condition', 'matchers': [{ 'type': 'IS_EQUAL_TO', 'data': { 'type': 'NUMBER', 'number': 42 }, 'attribute': 'age' }, { 'type': 'WHITELIST', 'data': { 'strings': ['a', 'b', 'c'] }, 'attribute': 'favoriteCharacter' }] }] } }],
98
};
109

11-
const expectedOutput: ISplitChangesResponse = {
10+
const EXPECTED_OUTPUT: ISplitChangesResponse = {
1211
ff: {
1312
s: 100,
1413
t: 200,
@@ -68,8 +67,8 @@ const expectedOutput: ISplitChangesResponse = {
6867
describe('convertConfigsResponseToDefinitionChangesResponse', () => {
6968

7069
test('should convert a configs response to a definition changes response', () => {
71-
const result = convertConfigsResponseToDefinitionChangesResponse(inputMock);
72-
expect(result).toEqual(expectedOutput);
70+
const result = convertConfigsResponseToDefinitionChangesResponse(INPUT);
71+
expect(result).toEqual(EXPECTED_OUTPUT);
7372
});
7473

7574
});

0 commit comments

Comments
 (0)