Skip to content

Commit

Permalink
test: add new test
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
  • Loading branch information
aaqilniz committed Aug 25, 2024
1 parent 7c8b374 commit 5016340
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/cli/test/unit/discover/import-discovered-model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,25 @@ describe('importDiscoveredModel', () => {
patient: {
type: 'String',
jsonSchema: {enum: ['INPATIENT', 'OUTPATIENT']},
required: false,
length: null,
precision: null,
scale: null,
mysql: {
columnName: 'type',
dataType: 'enum',
value: "'INPATIENT','OUTPATIENT'",
dataLength: 10,
dataPrecision: null,
dataScale: null,
nullable: 'Y',
generated: false,
},
},
},
};

const modelData = importDiscoveredModel(discoveredModel);
expect(modelData.properties).to.have.property('patient').deepEqual({
jsonSchema: "{enum: ['INPATIENT', 'OUTPATIENT']}",
mysql:
"{columnName: 'type', dataType: 'enum', value: '\\'INPATIENT\\',\\'OUTPATIENT\\'', dataLength: 10, dataPrecision: null, dataScale: null, nullable: 'Y', generated: false}",
type: `'string'`,
tsType: 'string',
});
Expand Down

0 comments on commit 5016340

Please sign in to comment.