diff --git a/.gitignore b/.gitignore index af0560062..647ae502f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ src/nativescript-angular/**/*.js .tscache .nvm .vscode +.DS_Store nativescript-angular*.tgz tests/app/**/*.js diff --git a/tests/app/fonts/icomoon.ttf b/tests/app/fonts/icomoon.ttf new file mode 100644 index 000000000..aaac5bf5f Binary files /dev/null and b/tests/app/fonts/icomoon.ttf differ diff --git a/tests/app/main.ts b/tests/app/main.ts index dfde37005..b44027695 100644 --- a/tests/app/main.ts +++ b/tests/app/main.ts @@ -3,7 +3,9 @@ import {nativeScriptBootstrap} from "nativescript-angular/application"; import {AppComponent} from "./app.component"; import {GestureComponent} from "./snippets/gestures.component"; import {LayoutsComponent} from "./snippets/layouts.component"; +import {IconFontComponent} from "./snippets/icon-font.component"; nativeScriptBootstrap(AppComponent); // nativeScriptBootstrap(GestureComponent); // nativeScriptBootstrap(LayoutsComponent); +// nativeScriptBootstrap(IconFontComponent); diff --git a/tests/app/snippets/icon-font.component.css b/tests/app/snippets/icon-font.component.css new file mode 100644 index 000000000..15940a9cf --- /dev/null +++ b/tests/app/snippets/icon-font.component.css @@ -0,0 +1,6 @@ +/* >> icon-font-sample */ +.icon { + font-family: 'icomoon'; + font-size: 48; +} +/* << icon-font-sample */ \ No newline at end of file diff --git a/tests/app/snippets/icon-font.component.ts b/tests/app/snippets/icon-font.component.ts new file mode 100644 index 000000000..f4ccc7634 --- /dev/null +++ b/tests/app/snippets/icon-font.component.ts @@ -0,0 +1,24 @@ +import {Component} from "angular2/core"; + +// >> icon-font-sample +@Component({ + // >> (hide) + selector: "icon-font", + templateUrl: "snippets/icon-font.component.xml", + styleUrls: ["snippets/icon-font.component.css"] + // << (hide) + // ... +}) +export class IconFontComponent { + public glyphs = new Array<{ icon: string, code: string }>(); + constructor() { + for (var charCode = 0xe903; charCode <= 0xeaea; charCode++) { + var glyph = { + icon: String.fromCharCode(charCode), + code: charCode.toString(16) + } + this.glyphs.push(glyph); + } + } +} +// << icon-font-sample \ No newline at end of file diff --git a/tests/app/snippets/icon-font.component.xml b/tests/app/snippets/icon-font.component.xml new file mode 100644 index 000000000..a460ec315 --- /dev/null +++ b/tests/app/snippets/icon-font.component.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/tests/app/tests/list-view-tests.ts b/tests/app/tests/list-view-tests.ts index ce345bfa5..0c7d550b5 100644 --- a/tests/app/tests/list-view-tests.ts +++ b/tests/app/tests/list-view-tests.ts @@ -43,7 +43,7 @@ export class TestListViewComponent { } } -// TODO: Skip list-view trest until +// TODO: Skip list-view test until karma test launcher double navigate bug is fixed (IS_IOS ? describe.skip : describe)('ListView-tests', () => { let testApp: TestApp = null; diff --git a/tests/app/tests/snippets.ts b/tests/app/tests/snippets.ts index af50c4441..cac60b4c6 100644 --- a/tests/app/tests/snippets.ts +++ b/tests/app/tests/snippets.ts @@ -5,6 +5,10 @@ import {TestApp} from "./test-app"; import {GestureComponent} from "../snippets/gestures.component"; import {LayoutsComponent} from "../snippets/layouts.component"; +import {IconFontComponent} from "../snippets/icon-font.component"; + +import {device, platformNames} from "platform"; +const IS_IOS = (device.os === platformNames.ios); describe('Snippets', () => { let testApp: TestApp = null; @@ -32,4 +36,12 @@ describe('Snippets', () => { assert.instanceOf(componentInstance, LayoutsComponent); }); }); + + // TODO: Skip list-view test until karma test launcher double navigate bug is fixed + (IS_IOS ? it.skip : it)("Icon-font snippets can be loaded", () => { + return testApp.loadComponent(IconFontComponent).then((componentRef) => { + const componentInstance = componentRef.instance; + assert.instanceOf(componentInstance, IconFontComponent); + }); + }); }) \ No newline at end of file