Updated angular to beta.6 + fix test

This commit is contained in:
Roman Hotsiy 2016-02-16 15:31:12 +02:00
parent a7913dec59
commit 503cbab2f0
5 changed files with 19 additions and 11 deletions

View File

@ -2,6 +2,8 @@
import { getChildDebugElement } from 'tests/helpers'; import { getChildDebugElement } from 'tests/helpers';
import {Component, View, provide} from 'angular2/core'; import {Component, View, provide} from 'angular2/core';
import OptionsManager from 'lib/options';
import {BrowserDomAdapter} from 'angular2/platform/browser';
import { import {
TestComponentBuilder, TestComponentBuilder,
@ -15,12 +17,14 @@ import MethodsList from 'lib/components/MethodsList/methods-list';
import SchemaManager from 'lib/utils/SchemaManager'; import SchemaManager from 'lib/utils/SchemaManager';
describe('Redoc components', () => { describe('Redoc components', () => {
describe('ApiInfo Component', () => { describe('MethodsList Component', () => {
let builder; let builder;
let component; let component;
let fixture; let fixture;
beforeEachProviders(() => [ beforeEachProviders(() => [
provide(SchemaManager, {useValue: new SchemaManager()}) provide(SchemaManager, {useValue: new SchemaManager()}),
provide(OptionsManager, {useClass: OptionsManager}),
provide(BrowserDomAdapter, {useClass: BrowserDomAdapter})
]); ]);
beforeEach(injectAsync([TestComponentBuilder, SchemaManager], (tcb, schemaMgr) => { beforeEach(injectAsync([TestComponentBuilder, SchemaManager], (tcb, schemaMgr) => {
builder = tcb; builder = tcb;
@ -32,7 +36,7 @@ describe('Redoc components', () => {
component = getChildDebugElement(fixture.debugElement, 'methods-list').componentInstance; component = getChildDebugElement(fixture.debugElement, 'methods-list').componentInstance;
fixture.detectChanges(); fixture.detectChanges();
done(); done();
}, err => { throw err; }); }, err => done.fail(err) );
}); });

View File

@ -14,7 +14,7 @@
<header> <header>
Response schema Response schema
</header> </header>
<json-schema *ngIf="response.schema && !enabledLazy" class="schema type" pointer="{{response.pointer}}/schema"> <json-schema *ngIf="response.schema && options.disableLazySchemas" class="schema type" pointer="{{response.pointer}}/schema">
</json-schema> </json-schema>
<json-schema-lazy #lazySchema pointer="{{response.schema ? response.pointer + '/schema' : null}}"> <json-schema-lazy #lazySchema pointer="{{response.schema ? response.pointer + '/schema' : null}}">
</json-schema-lazy> </json-schema-lazy>

View File

@ -1,11 +1,12 @@
'use strict'; 'use strict';
import {RedocComponent, BaseComponent} from '../base'; import {RedocComponent, BaseComponent, SchemaManager} from '../base';
import JsonPointer from '../../utils/JsonPointer'; import JsonPointer from '../../utils/JsonPointer';
import JsonSchema from '../JsonSchema/json-schema'; import JsonSchema from '../JsonSchema/json-schema';
import JsonSchemaLazy from '../JsonSchema/json-schema-lazy'; import JsonSchemaLazy from '../JsonSchema/json-schema-lazy';
import Zippy from '../../common/components/Zippy/zippy'; import Zippy from '../../common/components/Zippy/zippy';
import {statusCodeType} from '../../utils/helpers'; import {statusCodeType} from '../../utils/helpers';
import OptionsManager from '../../options';
function isNumeric(n) { function isNumeric(n) {
return (!isNaN(parseFloat(n)) && isFinite(n)); return (!isNaN(parseFloat(n)) && isFinite(n));
@ -17,9 +18,11 @@ function isNumeric(n) {
styleUrls: ['./lib/components/ResponsesList/responses-list.css'], styleUrls: ['./lib/components/ResponsesList/responses-list.css'],
directives: [JsonSchema, Zippy, JsonSchemaLazy] directives: [JsonSchema, Zippy, JsonSchemaLazy]
}) })
@Reflect.metadata('parameters', [[SchemaManager], [OptionsManager]])
export default class ResponsesList extends BaseComponent { export default class ResponsesList extends BaseComponent {
constructor(schemaMgr) { constructor(schemaMgr, optionsMgr) {
super(schemaMgr); super(schemaMgr);
this.options = optionsMgr.options;
} }
prepareModel() { prepareModel() {

View File

@ -29,8 +29,9 @@
"jspm": { "jspm": {
"configFile": "system.config.js", "configFile": "system.config.js",
"dependencies": { "dependencies": {
"angular2": "npm:angular2@2.0.0-beta.3", "angular2": "npm:angular2@2.0.0-beta.6",
"es6-shim": "github:es-shims/es6-shim@^0.33.6", "es6-shim": "github:es-shims/es6-shim@^0.33.6",
"json": "github:systemjs/plugin-json@^0.1.0",
"json-formatter-js": "npm:json-formatter-js@^0.2.0", "json-formatter-js": "npm:json-formatter-js@^0.2.0",
"json-pointer": "npm:json-pointer@^0.3.0", "json-pointer": "npm:json-pointer@^0.3.0",
"json-schema-instantiator": "npm:json-schema-instantiator@^0.3.0", "json-schema-instantiator": "npm:json-schema-instantiator@^0.3.0",

View File

@ -37,7 +37,7 @@ System.config({
}, },
map: { map: {
"angular2": "npm:angular2@2.0.0-beta.3", "angular2": "npm:angular2@2.0.0-beta.6",
"babel": "npm:babel-core@5.8.34", "babel": "npm:babel-core@5.8.34",
"babel-runtime": "npm:babel-runtime@5.8.34", "babel-runtime": "npm:babel-runtime@5.8.34",
"clean-css": "npm:clean-css@3.4.6", "clean-css": "npm:clean-css@3.4.6",
@ -135,14 +135,14 @@ System.config({
"path": "github:jspm/nodelibs-path@0.1.0", "path": "github:jspm/nodelibs-path@0.1.0",
"process": "github:jspm/nodelibs-process@0.1.2" "process": "github:jspm/nodelibs-process@0.1.2"
}, },
"npm:angular2@2.0.0-beta.3": { "npm:angular2@2.0.0-beta.6": {
"crypto": "github:jspm/nodelibs-crypto@0.1.0", "crypto": "github:jspm/nodelibs-crypto@0.1.0",
"es6-promise": "npm:es6-promise@3.0.2", "es6-promise": "npm:es6-promise@3.0.2",
"es6-shim": "npm:es6-shim@0.33.13", "es6-shim": "npm:es6-shim@0.33.13",
"process": "github:jspm/nodelibs-process@0.1.2", "process": "github:jspm/nodelibs-process@0.1.2",
"reflect-metadata": "npm:reflect-metadata@0.1.2", "reflect-metadata": "npm:reflect-metadata@0.1.2",
"rxjs": "npm:rxjs@5.0.0-beta.0", "rxjs": "npm:rxjs@5.0.0-beta.0",
"zone.js": "npm:zone.js@0.5.11" "zone.js": "npm:zone.js@0.5.14"
}, },
"npm:argparse@1.0.3": { "npm:argparse@1.0.3": {
"assert": "github:jspm/nodelibs-assert@0.1.0", "assert": "github:jspm/nodelibs-assert@0.1.0",
@ -866,7 +866,7 @@ System.config({
"systemjs-json": "github:systemjs/plugin-json@0.1.0", "systemjs-json": "github:systemjs/plugin-json@0.1.0",
"validator": "npm:validator@4.5.0" "validator": "npm:validator@4.5.0"
}, },
"npm:zone.js@0.5.11": { "npm:zone.js@0.5.14": {
"es6-promise": "npm:es6-promise@3.0.2", "es6-promise": "npm:es6-promise@3.0.2",
"process": "github:jspm/nodelibs-process@0.1.2" "process": "github:jspm/nodelibs-process@0.1.2"
} }