1 | "use strict";
|
2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7 | };
|
8 | var __metadata = (this && this.__metadata) || function (k, v) {
|
9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10 | };
|
11 | var ModelDecorations_1 = require("../decorations/ModelDecorations");
|
12 | var Constants_1 = require("../Constants");
|
13 | var MetadataManager_1 = require("../MetadataManager");
|
14 | var DecorationTest = (function () {
|
15 | function DecorationTest() {
|
16 | }
|
17 | return DecorationTest;
|
18 | }());
|
19 | __decorate([
|
20 | ModelDecorations_1.Attribute(),
|
21 | __metadata("design:type", String)
|
22 | ], DecorationTest.prototype, "myString", void 0);
|
23 | DecorationTest = __decorate([
|
24 | ModelDecorations_1.Model()
|
25 | ], DecorationTest);
|
26 | describe('#typestore', function () {
|
27 | describe('#model-decorations', function () {
|
28 | before(function () {
|
29 | new DecorationTest();
|
30 | });
|
31 | it("#hasModelOptions", function () {
|
32 | var md = MetadataManager_1.getMetadata(Constants_1.TypeStoreModelKey, DecorationTest);
|
33 | expect(md.clazz).toBe(DecorationTest);
|
34 | expect(md.clazzName).toBe('DecorationTest');
|
35 | expect(md.attrs.length).toBe(1);
|
36 | });
|
37 | it("#hasAttrOptions", function () {
|
38 | var md = MetadataManager_1.getMetadata(Constants_1.TypeStoreAttrKey, DecorationTest, 'myString');
|
39 | expect(md.name).toBe('myString');
|
40 | expect(md.type).toBe(String);
|
41 | });
|
42 | });
|
43 | });
|
44 |
|
\ | No newline at end of file |