UNPKG

systelab-components-test

Version:

Widgets to be use in the E2E Tests based in Protractor

28 lines (27 loc) 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); require("reflect-metadata"); var AttributeType; (function (AttributeType) { AttributeType[AttributeType["Text"] = 0] = "Text"; AttributeType[AttributeType["Date"] = 1] = "Date"; AttributeType[AttributeType["Number"] = 2] = "Number"; AttributeType[AttributeType["Password"] = 3] = "Password"; })(AttributeType = exports.AttributeType || (exports.AttributeType = {})); exports.ATTRIBUTE_PREFIX = 'test:'; /** * Adds attribute metadata to a property * @param {IAttributeProperties} attributes * @returns {(target: any, propertyKey: string) => void} * @constructor */ function TestAttribute(attributes) { return function (target, propertyKey) { if (attributes !== undefined && attributes !== null) { Object.keys(attributes).forEach(function (key) { Reflect.defineMetadata("" + exports.ATTRIBUTE_PREFIX + key, attributes[key], target, propertyKey); }); } }; } exports.TestAttribute = TestAttribute;