beerbay-math
Version:
18 lines (15 loc) • 696 B
JavaScript
;
var _countries = require("./mock/countries");
var _country = require("./country");
describe('getSelectedCoutry', function () {
test('Retrieve Spain', function () {
expect((0, _country.getSelectedCountry)(1, _countries.MOCK_SHIPPING_COUNTRIES).name).toBe('Spain');
expect((0, _country.getSelectedCountry)(1, _countries.MOCK_SHIPPING_COUNTRIES).free_shipping).toBe(95);
expect((0, _country.getSelectedCountry)(1, _countries.MOCK_SHIPPING_COUNTRIES).max_shipping).toBe(24);
});
test('On Failure throw', function () {
expect(function () {
return (0, _country.getSelectedCountry)('asd', _countries.MOCK_SHIPPING_COUNTRIES);
}).toThrow(Error);
});
});