Skip to content

Commit 70f02bf

Browse files
committed
remove 'content' field from mock data schema response
1 parent 452d8f8 commit 70f02bf

File tree

2 files changed

+37
-41
lines changed

2 files changed

+37
-41
lines changed

packages/compass-collection/src/components/mock-data-generator-modal/mock-data-generator-modal.spec.tsx

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -428,26 +428,24 @@ describe('MockDataGeneratorModal', () => {
428428
const mockServices = createMockServices();
429429
mockServices.atlasAiService.getMockDataSchema = () =>
430430
Promise.resolve({
431-
content: {
432-
fields: [
433-
{
434-
fieldPath: 'name',
435-
mongoType: 'String',
436-
fakerMethod: 'person.firstName',
437-
fakerArgs: [],
438-
isArray: false,
439-
probability: 1.0,
440-
},
441-
{
442-
fieldPath: 'email',
443-
mongoType: 'String',
444-
fakerMethod: 'internet.email',
445-
fakerArgs: [],
446-
isArray: false,
447-
probability: 1.0,
448-
},
449-
],
450-
},
431+
fields: [
432+
{
433+
fieldPath: 'name',
434+
mongoType: 'String',
435+
fakerMethod: 'person.firstName',
436+
fakerArgs: [],
437+
isArray: false,
438+
probability: 1.0,
439+
},
440+
{
441+
fieldPath: 'email',
442+
mongoType: 'String',
443+
fakerMethod: 'internet.email',
444+
fakerArgs: [],
445+
isArray: false,
446+
probability: 1.0,
447+
},
448+
],
451449
});
452450
await renderModal({
453451
mockServices,
@@ -468,26 +466,24 @@ describe('MockDataGeneratorModal', () => {
468466
const mockServices = createMockServices();
469467
mockServices.atlasAiService.getMockDataSchema = () =>
470468
Promise.resolve({
471-
content: {
472-
fields: [
473-
{
474-
fieldPath: 'name',
475-
mongoType: 'String',
476-
fakerMethod: 'person.firstName',
477-
fakerArgs: [],
478-
isArray: false,
479-
probability: 1.0,
480-
},
481-
{
482-
fieldPath: 'age',
483-
mongoType: 'Int32',
484-
fakerMethod: 'number.int',
485-
fakerArgs: [],
486-
isArray: false,
487-
probability: 1.0,
488-
},
489-
],
490-
},
469+
fields: [
470+
{
471+
fieldPath: 'name',
472+
mongoType: 'String',
473+
fakerMethod: 'person.firstName',
474+
fakerArgs: [],
475+
isArray: false,
476+
probability: 1.0,
477+
},
478+
{
479+
fieldPath: 'age',
480+
mongoType: 'Int32',
481+
fakerMethod: 'number.int',
482+
fakerArgs: [],
483+
isArray: false,
484+
probability: 1.0,
485+
},
486+
],
491487
});
492488

493489
await renderModal({

packages/compass-collection/src/modules/collection-tab.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ export const generateFakerMappings = (): CollectionThunkAction<
874874

875875
const validatedFakerSchema = validateFakerSchema(
876876
schemaAnalysis.processedSchema,
877-
response.content.fields,
877+
response.fields,
878878
logger
879879
);
880880

0 commit comments

Comments
 (0)