Skip to content

Commit

Permalink
skip optional test for product
Browse files Browse the repository at this point in the history
  • Loading branch information
schaechinger committed Mar 26, 2018
1 parent f65c622 commit e128072
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/ProductList/Product.data.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,30 @@
"name": "Standardbrief Integral + EINSCHREIBEN EINWURF"
}
}
],
"skipOptional": [
{
"raw": {
"extendedIdentifier": {
"externIdentifier": {
"attributes": {
"id": "1002",
"name": "Standardbrief Integral + EINSCHREIBEN EINWURF",
"actualPPLVersion": "39"
}
}
},
"priceDefinition": {
"price": {
"calculatedGrossPrice": {
"attributes": {
"value": "2.85"
}
}
}
}
}
}
]
}
}
10 changes: 10 additions & 0 deletions test/ProductList/Product.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,15 @@ describe('Product', () => {
product._ppl.should.equal(data.gen.ppl);
});
});

it('should skip optional information if not given', () => {
TEST_DATA.data.skipOptional.forEach(data => {
const product = new Product(data.raw);

product.isValid().should.be.true();
product._dimensions.should.be.empty();
product._weight.should.be.empty;
});
});
});
});

0 comments on commit e128072

Please sign in to comment.