@vidal-community/vidal-web-components
Version:
Vidal Web Components
22 lines • 918 B
JavaScript
import { Drug, DrugType } from './drug';
import { assert } from '@open-wc/testing';
suite('drugs', () => {
suite('isOffMarKetUcd', () => {
test('should return false when drug is not an UCD', () => {
const drug = createDrug(DrugType.PACK, 'DELETED');
assert.isFalse(drug.isOffMarKetUcd());
});
test('should return false when UCD is not offmarket', () => {
const drug = createDrug(DrugType.UCD, 'AVAILABLE');
assert.isFalse(drug.isOffMarKetUcd());
});
test('should return true when UCD is offmarket', () => {
const drug = createDrug(DrugType.UCD, 'DELETED');
assert.isTrue(drug.isOffMarKetUcd());
});
});
});
function createDrug(type, marketStatus) {
return new Drug(1, 1, 1, 'a drug', 'ucd', 1, type, '', marketStatus, 1, undefined, 1, undefined);
}
//# sourceMappingURL=drug_test.js.map