Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Provider Side Data :
- {"name":"Demo Taxonomy","taxons":[{"id":8145188,"name":"manojtaxon","childCategoryName":"hello","hasChildren":true},{"id":8094058,"name":"taxnon4","hasChildren":false},{"id":8094014,"name":"taxon1","childCategoryName":"Taxon 1 Cat","hasChildren":true},{"id":8094016,"name":"taxon2","hasChildren":false},{"id":8094022,"name":"taxon3","hasChildren":false},{"id":8094024,"name":"taxon4","hasChildren":false},{"id":8094028,"name":"taxon5","hasChildren":false},{"id":8094030,"name":"taxon6","hasChildren":false},{"id":8094032,"name":"taxon7","hasChildren":false},{"id":8094036,"name":"taxon8","hasChildren":false},{"id":8094040,"name":"taxon9","hasChildren":false},{"id":8094050,"name":"taxonn1","hasChildren":false},{"id":8094052,"name":"taxonn2","hasChildren":false},{"id":8094054,"name":"taxonn3","childCategoryName":"list1","hasChildren":true}]}
- Consumer side data :
- const firstChild = {
- 'name': 'Geo',
- 'taxons': [
- {
- 'id': 115590,
- 'name': 'Africa',
- 'hasChildren': false
- },
- {
- 'id': 115586,
- 'name': 'America',
- 'hasChildren': false
- },
- {
- 'id': 115578,
- 'name': 'Asia',
- 'childCategoryName': 'Country',
- 'hasChildren': true
- },
- {
- 'id': 115582,
- 'name': 'Europe',
- 'hasChildren': false
- }
- ]
- };
- So I am using matchers currently like this :
- const firstChild = eachLike({
- 'name': like('Geo'),
- 'taxons': eachLike({
- 'id': 115590,
- 'name': 'Africa',
- 'hasChildren': false
- })
- })
- But then not sure how to use it for array size more than 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement