-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move check to validation and add test coverage
- Loading branch information
1 parent
5ec493e
commit 2cb6ca1
Showing
3 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -261,6 +261,18 @@ describe('Serializer', () => { | |
}); | ||
}); | ||
|
||
it('should throw if the value for a map is not a Map instance', () => { | ||
let address = factory.newConcept('org.acme.sample', 'Address'); | ||
address.city = 'Winchester'; | ||
address.country = 'UK'; | ||
address.elevation = 3.14; | ||
address.postcode = 'SO21 2JN'; | ||
address.testMap = 'xyz'; // bad value | ||
(() => { | ||
serializer.toJSON(address); | ||
}).should.throw(Error, /Expected a Map, but found xyz/); | ||
}); | ||
|
||
it('should generate a field if an empty string is specififed', () => { | ||
let resource = factory.newResource('org.acme.sample', 'SampleAsset', '1'); | ||
resource.owner = factory.newRelationship('org.acme.sample', 'SampleParticipant', '[email protected]'); | ||
|