UNPKG

@ozmap/ozn-sdk

Version:

OZN SDK is a powerful tool for developers to build their own applications on top of OZN using TMForum pattern.

117 lines (116 loc) 5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const service_qualification_1 = require("./service-qualification"); describe('Service Qualification Schemas', () => { it('should validate serviceQualificationByIdInputSchema', () => { const validData = { serviceQualificationItem: [ { service: { place: { externalId: '123', externalSystem: 'system', }, }, }, ], }; expect(() => service_qualification_1.serviceQualificationByIdInputSchema.parse(validData)).not.toThrow(); }); it('should validate ServiceQualificationAddressSchema', () => { const validData = { type: 'addressType', geographicLocation: { name: 'locationName', type: 'Point', geometry: [{ x: 1, y: 2, z: null }], }, }; expect(() => service_qualification_1.ServiceQualificationAddressSchema.parse(validData)).not.toThrow(); }); it('should validate EligibilityUnavailabilityReasonSchema', () => { const validData = { code: 'code', label: 'label', }; expect(() => service_qualification_1.EligibilityUnavailabilityReasonSchema.parse(validData)).not.toThrow(); }); it('should validate RelatedEntitySchema', () => { const validData = { '@type': 'type', qualificationResult: 'result', characteristic: [{ name: 'name', valueType: 'string', value: 'value' }], resourceSpecification: { id: 'id', cellName: null, type: 'type', name: 'name', feedingHeadend: 'headend', project: 'project', }, resourceLocation: { type: 'type', labelType: 'label', name: 'name', description: null, parentLocation: 'parent', address: { type: 'addressType', geographicLocation: { name: 'locationName', type: 'Point', geometry: [{ x: 1, y: 2, z: null }], }, }, }, eligibilityUnavailabilityReason: [{ code: 'code', label: 'label' }], }; expect(() => service_qualification_1.RelatedEntitySchema.parse(validData)).not.toThrow(); }); it('should validate serviceQualificationOutputSchema', () => { const validData = { provideUnavailabilityReason: true, serviceQualificationItem: [ { qualificationResult: 'qualified', service: { serviceCharacteristic: [{ name: 'name', valueType: 'string', value: 'value' }], relatedEntity: [ { '@type': 'type', qualificationResult: 'result', characteristic: [{ name: 'name', valueType: 'string', value: 'value' }], resourceSpecification: { id: 'id', cellName: null, type: 'type', name: 'name', feedingHeadend: 'headend', project: 'project', }, resourceLocation: { type: 'type', labelType: 'label', name: 'name', description: null, parentLocation: 'parent', address: { type: 'addressType', geographicLocation: { name: 'locationName', type: 'Point', geometry: [{ x: 1, y: 2, z: null }], }, }, }, eligibilityUnavailabilityReason: [{ code: 'code', label: 'label' }], }, ], }, eligibilityUnavailabilityReason: [{ code: 'code', label: 'label' }], }, ], }; expect(() => service_qualification_1.serviceQualificationOutputSchema.parse(validData)).not.toThrow(); }); });