Skip to content

Commit

Permalink
add test for definition
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Van Haerenborgh <dirk.vanhaerenborgh@aloxy.io>
  • Loading branch information
vhdirk committed Feb 5, 2021
1 parent b987ba9 commit 522e5a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions javascript/lib/api/tests/model/things.model.spec.ts
Expand Up @@ -36,7 +36,8 @@ const thingObj = {
features: featuresObj,
_revision: 0,
_modified: '08042019',
acl: aclObj
acl: aclObj,
_definition: 'org.eclipse.ditto:Testthing:0.0.1'
};
const responseObj = { items: [thingObj], nextPageOffset: 0 };

Expand All @@ -47,7 +48,7 @@ const features = typedFeatureObject;
const anAclEntry = new AclEntry('ID', true, true, true);
const anotherAclEntry = new AclEntry('AnotherID', false, false, false);
const acl = { ID: anAclEntry, AnotherID: anotherAclEntry };
const thing = new Thing('Testspace:Testthing', 'PolicyId', attributes, features, 0, '08042019', acl);
const thing = new Thing('Testspace:Testthing', 'PolicyId', attributes, features, 0, '08042019', acl, 'org.eclipse.ditto:Testthing:0.0.1');
const response = new SearchThingsResponse([thing], 0);

describe('Feature', () => {
Expand Down Expand Up @@ -137,6 +138,7 @@ describe('Thing', () => {
expect(thing._revision).toEqual(0);
expect(thing.name).toEqual('Testthing');
expect(thing.acl).toEqual(acl);
expect(thing.definition).toEqual('org.eclipse.ditto:Testthing:0.0.1');
});
it('handles a minimal thing', () => {
const minimalThing = new Thing('Tespspace:Minimal');
Expand Down

0 comments on commit 522e5a4

Please sign in to comment.