Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow package small for nl and be #208

Merged
merged 4 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/data/carriers/abstractCarrierConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class AbstractCarrierConfiguration {
case PACKAGE_TYPE_PACKAGE:
return true;
case PACKAGE_TYPE_PACKAGE_SMALL:
return ![NETHERLANDS, BELGIUM].includes(country) && this.hasFeature(ALLOW_PACKAGE_TYPE_PACKAGE_SMALL);
return BELGIUM !== country && this.hasFeature(ALLOW_PACKAGE_TYPE_PACKAGE_SMALL);
case PACKAGE_TYPE_MAILBOX:
return this.hasFeature(ALLOW_PACKAGE_TYPE_MAILBOX);
case PACKAGE_TYPE_DIGITAL_STAMP:
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/delivery-options/carrierConfiguration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
FEATURES_PACKAGE_TYPE_MAILBOX,
FEATURES_PICKUP,
FEATURES_SATURDAY_DELIVERY,
FEATURES_PACKAGE_TYPE_PACKAGE_SMALL,
} from '@/data/carrierFeatures';
import { PACKAGE_TYPE_DIGITAL_STAMP, PACKAGE_TYPE_MAILBOX, PACKAGE_TYPE_PACKAGE_SMALL } from '@/data/keys/settingsConsts';
import { AbstractCarrierConfiguration } from '@/data/carriers/abstractCarrierConfiguration';
Expand Down Expand Up @@ -36,6 +37,7 @@ class MockCarrierConfiguration extends AbstractCarrierConfiguration {
FEATURES_DELIVERY,
FEATURES_PICKUP,
FEATURES_PACKAGE_TYPE_MAILBOX,
FEATURES_PACKAGE_TYPE_PACKAGE_SMALL,
],
};
}
Expand All @@ -60,7 +62,7 @@ describe('CarrierConfiguration', () => {
expect(config.allowsPackageTypeIn(PACKAGE_TYPE_DIGITAL_STAMP, 'NL')).toBe(false);
expect(config.allowsPackageTypeIn(PACKAGE_TYPE_MAILBOX, 'NL')).toBe(true);
expect(config.allowsPackageTypeIn(PACKAGE_TYPE_MAILBOX, 'BE')).toBe(true);
expect(config.allowsPackageTypeIn(PACKAGE_TYPE_PACKAGE_SMALL, 'NL')).toBe(false);
expect(config.allowsPackageTypeIn(PACKAGE_TYPE_PACKAGE_SMALL, 'NL')).toBe(true);
expect(config.allowsPackageTypeIn(PACKAGE_TYPE_PACKAGE_SMALL, 'BE')).toBe(false);
expect(config.allowsPackageTypeIn('NonExistentType', 'NL')).toBe(false);
});
Expand Down
Loading