@ozmap/ozn-sdk
Version:
OZN SDK is a powerful tool for developers to build their own applications on top of OZN using TMForum pattern.
53 lines (52 loc) • 2.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const resource_pool_management_1 = require("./resource-pool-management");
describe('ResourcePoolManagementInputSchema', () => {
it('should validate a correct input', () => {
const validInput = {
relatedParty: {
role: 'Manager',
property: [{ name: 'Department', value: 'IT' }],
},
reservationItem: [
{
resourceCapacity: {
place: {
externalId: 'EXT-001',
externalSystem: 'External System A',
},
},
appliedCapacityAmount: {
characteristic: [{ name: 'Capacity', value: '10GB', valueType: 'string' }],
},
},
],
};
expect(() => resource_pool_management_1.resourcePoolManagementInputSchema.parse(validInput)).not.toThrow();
});
it('should fail validation for missing required fields', () => {
const invalidInput = {
reservationItem: [], // missing relatedParty
};
expect(() => resource_pool_management_1.resourcePoolManagementInputSchema.parse(invalidInput)).toThrow();
});
it('should fail validation for incorrect field types', () => {
const invalidInput = {
relatedParty: {
role: 123,
property: [{ name: 'Department', value: 456 }],
},
reservationItem: [
{
resourceCapacity: {
systemId: 999,
},
appliedCapacityAmount: {
characteristic: [{ name: 'Capacity', value: true }],
},
},
],
};
expect(() => resource_pool_management_1.resourcePoolManagementInputSchema.parse(invalidInput)).toThrow();
});
});