Skip to content

Commit

Permalink
feat(map): adds more test coverage for MapKeyType introspection
Browse files Browse the repository at this point in the history
Signed-off-by: jonathan.casey <[email protected]>
  • Loading branch information
jonathan-casey committed Aug 9, 2023
1 parent 5f627f8 commit b5d6c83
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/concerto-core/test/introspect/mapdeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ describe('MapDeclaration', () => {
name: 'States'
}
},

value: {
$class: '[email protected]'
}
Expand Down Expand Up @@ -426,9 +425,7 @@ describe('MapDeclaration', () => {
clz.getKey().ast.$class.should.equal('[email protected]');
});


// TODO :: Add coverage for Object Scalars
it('should return the correct values when called', () => {
it('should return the correct values when called - String', () => {
let clz = new MapDeclaration(modelFile, {
$class: '[email protected]',
name: 'MapPermutation1',
Expand All @@ -442,7 +439,7 @@ describe('MapDeclaration', () => {
clz.getKey().getType().should.equal('String');
});

it('should return the correct values when called', () => {
it('should return the correct values when called - DateTime', () => {
let clz = new MapDeclaration(modelFile, {
$class: '[email protected]',
name: 'MapPermutation1',
Expand All @@ -455,6 +452,17 @@ describe('MapDeclaration', () => {
});
clz.getKey().getType().should.equal('DateTime');
});


it('should return the correct values when called - Scalar DateTime', () => {
let decl = introspectUtils.loadLastDeclaration('test/data/parser/mapdeclaration/mapdeclaration.goodkey.scalar.datetime.cto', MapDeclaration);
decl.getKey().getType().should.equal('DATE');
});

it('should return the correct values when called - Scalar String', () => {
let decl = introspectUtils.loadLastDeclaration('test/data/parser/mapdeclaration/mapdeclaration.goodkey.scalar.string.cto', MapDeclaration);
decl.getKey().getType().should.equal('GUID');
});
});

describe('#getValue', () => {
Expand Down

0 comments on commit b5d6c83

Please sign in to comment.