mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-24 05:05:39 +00:00
Revert changes to common.spec.js
This commit is contained in:
@@ -24,25 +24,25 @@ describe('utils: flattenDataForDotNotation', () => {
|
||||
{ name: 'Bob', age: 28 },
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
const expectedOutput = {
|
||||
'users[0].name': 'Alice',
|
||||
'users[0].age': 25,
|
||||
'users[1].name': 'Bob',
|
||||
'users[1].age': 28,
|
||||
};
|
||||
|
||||
|
||||
expect(flattenDataForDotNotation(input)).toEqual(expectedOutput);
|
||||
});
|
||||
|
||||
|
||||
test('Flatten an empty object', () => {
|
||||
const input = {};
|
||||
|
||||
|
||||
const expectedOutput = {};
|
||||
|
||||
|
||||
expect(flattenDataForDotNotation(input)).toEqual(expectedOutput);
|
||||
});
|
||||
|
||||
|
||||
test('Flatten an object with nested objects', () => {
|
||||
const input = {
|
||||
person: {
|
||||
@@ -53,16 +53,16 @@ describe('utils: flattenDataForDotNotation', () => {
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
const expectedOutput = {
|
||||
'person.name': 'Alice',
|
||||
'person.address.city': 'New York',
|
||||
'person.address.zipcode': '10001',
|
||||
};
|
||||
|
||||
|
||||
expect(flattenDataForDotNotation(input)).toEqual(expectedOutput);
|
||||
});
|
||||
|
||||
|
||||
test('Flatten an object with arrays of objects', () => {
|
||||
const input = {
|
||||
teams: [
|
||||
@@ -70,7 +70,7 @@ describe('utils: flattenDataForDotNotation', () => {
|
||||
{ name: 'Team B', members: ['Charlie', 'David'] },
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
const expectedOutput = {
|
||||
'teams[0].name': 'Team A',
|
||||
'teams[0].members[0]': 'Alice',
|
||||
@@ -79,7 +79,7 @@ describe('utils: flattenDataForDotNotation', () => {
|
||||
'teams[1].members[0]': 'Charlie',
|
||||
'teams[1].members[1]': 'David',
|
||||
};
|
||||
|
||||
|
||||
expect(flattenDataForDotNotation(input)).toEqual(expectedOutput);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user