Skip to content

Commit

Permalink
upgrade ionic / port to ionic-unit-testing-example
Browse files Browse the repository at this point in the history
  • Loading branch information
lathonez committed Mar 24, 2017
1 parent 689c02f commit 3a8b610
Show file tree
Hide file tree
Showing 20 changed files with 260 additions and 359 deletions.
54 changes: 0 additions & 54 deletions .angular-cli.json

This file was deleted.

84 changes: 45 additions & 39 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.clickerf0281363" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Clicker</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="shazleto@gmail.com" href="http://ionicframework.com/">Stephen Hazleton</author>
<content src="index.html"/>
<access origin="*"/>
<allow-navigation href="http://ionic.local/*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
</platform>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashMaintainAspectRatio" value="true"/>
<preference name="FadeSplashScreenDuration" value="300"/>
<preference name="SplashShowOnlyFirstTime" value="false"/>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
<plugin name="cordova-plugin-whitelist" spec="1.3.1"/>
<plugin name="cordova-plugin-console" spec="1.0.5"/>
<plugin name="cordova-plugin-statusbar" spec="2.2.1"/>
<plugin name="cordova-plugin-device" spec="1.1.4"/>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1"/>
</widget>
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Clicker</name>
<description>Clicker - An Ionic App</description>
<author email="shazleto@gmail.com" href="http://lathonez.com/">Stephen Hazleton</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="http://ionic.local/*"/>
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />

<!--
Change these to configure how the splashscreen displays and fades in/out.
More info here: https://github.com/apache/cordova-plugin-splashscreen
-->
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>

<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
<plugin name="cordova-plugin-whitelist" spec="1.3.1"/>
<plugin name="cordova-plugin-console" spec="1.0.5"/>
<plugin name="cordova-plugin-statusbar" spec="2.2.1"/>
<plugin name="cordova-plugin-device" spec="1.1.4"/>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1"/>
</widget>
5 changes: 2 additions & 3 deletions ionic.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "clicker",
"name": "Clicker",
"app_id": "f0281363",
"typescript": true,
"v2": true
"projectTypeId": "ionic-angular"
}
44 changes: 0 additions & 44 deletions karma.conf.js

This file was deleted.

84 changes: 37 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,63 +11,53 @@
"e2e": "ionic-app-scripts build && protractor",
"postinstall": "ionic state restore && webdriver-manager update",
"start": "ionic serve",
"test": "ng test",
"test-coverage": "ng test --code-coverage",
"test-ci": "ng test --watch=false --code-coverage"
"test": "karma start ./test-config/karma.conf.js"
},
"version": "2.9.0",
"dependencies": {
"@angular/common": "2.4.0",
"@angular/compiler": "2.4.0",
"@angular/compiler-cli": "2.4.0",
"@angular/core": "2.4.0",
"@angular/forms": "2.4.0",
"@angular/http": "2.4.0",
"@angular/platform-browser": "2.4.0",
"@angular/platform-browser-dynamic": "2.4.0",
"@angular/platform-server": "2.4.0",
"@angular/router": "3.4.0",
"@ionic/storage": "1.1.7",
"ionic-angular": "2.1.0",
"ionic-native": "2.4.1",
"@angular/common": "2.4.8",
"@angular/compiler": "2.4.8",
"@angular/compiler-cli": "2.4.8",
"@angular/core": "2.4.8",
"@angular/forms": "2.4.8",
"@angular/http": "2.4.8",
"@angular/platform-browser": "2.4.8",
"@angular/platform-browser-dynamic": "2.4.8",
"@angular/platform-server": "2.4.8",
"@ionic-native/core": "3.1.0",
"@ionic-native/splash-screen": "3.1.0",
"@ionic-native/status-bar": "3.1.0",
"@ionic/storage": "2.0.0",
"ionic-angular": "2.2.0",
"ionicons": "3.0.0",
"rxjs": "5.1.0",
"rxjs": "5.0.1",
"sw-toolbox": "3.4.0",
"zone.js": "0.7.6"
"zone.js": "0.7.2"
},
"devDependencies": {
"@angular/cli": "1.0.0-rc.0",
"@ionic/app-scripts": "1.1.3",
"@types/jasmine": "2.5.41",
"@types/node": "7.0.4",
"codecov": "1.0.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "3.2.0",
"karma": "1.4.1",
"karma-chrome-launcher": "2.0.0",
"karma-cli": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"karma-coverage-istanbul-reporter": "0.2.0",
"@ionic/app-scripts": "1.1.4",
"@ionic/cli-build-ionic-angular": "0.0.3",
"@ionic/cli-plugin-cordova": "0.0.9",
"@types/jasmine": "^2.5.41",
"@types/node": "^7.0.8",
"angular2-template-loader": "^0.6.2",
"html-loader": "^0.4.5",
"jasmine": "^2.5.3",
"karma": "^1.5.0",
"karma-chrome-launcher": "^2.0.0",
"karma-jasmine": "^1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.3",
"null-loader": "^0.1.1",
"protractor": "4.0.13",
"ts-node": "1.2.1",
"tslint": "4.4.1",
"tslint-eslint-rules": "3.2.3",
"typescript": "2.0.10"
"ts-loader": "^2.0.3",
"typescript": "2.1.6"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"version": "3.0.0",
"description": "Clicker: An Ionic project",
"repository": {
"type": "git",
"url": "https://github.com/lathonez/clicker.git"
},
"license": "MIT",
"description": "Clicker: An Ionic project"
"license": "MIT"
}
39 changes: 39 additions & 0 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { async, TestBed } from '@angular/core/testing';
import { IonicModule } from 'ionic-angular';

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { ClickerApp } from './app.component';

describe('ClickerApp Component', () => {
let fixture: any;
let component: ClickerApp;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ClickerApp],
imports: [
IonicModule.forRoot(ClickerApp),
],
providers: [
StatusBar,
SplashScreen,
],
});
}));

beforeEach(() => {
fixture = TestBed.createComponent(ClickerApp);
component = fixture.componentInstance;
});

it ('should be created', () => {
expect(component instanceof ClickerApp).toBe(true);
});

it ('should have two pages', () => {
expect(component.pages.length).toBe(2);
});

});
13 changes: 9 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, ViewChild } from '@angular/core';
import { Platform, MenuController, Nav } from 'ionic-angular';
import { StatusBar, Splashscreen } from 'ionic-native';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { ClickerList, Page2 } from '../pages';

@Component({
Expand All @@ -14,11 +15,15 @@ export class ClickerApp {
public pages: Array<{ title: string, component: any }>;
private menu: MenuController;
private platform: Platform;
private splash: SplashScreen;
private status: StatusBar;

constructor(platform: Platform, menu: MenuController) {
constructor(platform: Platform, menu: MenuController, splash: SplashScreen, status: StatusBar, ) {

this.platform = platform;
this.menu = menu;
this.splash = splash;
this.status = status;

this.rootPage = ClickerList;
this.initializeApp();
Expand All @@ -34,8 +39,8 @@ export class ClickerApp {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
StatusBar.styleDefault();
Splashscreen.hide();
this.status.styleDefault();
this.splash.hide();
});
}

Expand Down
4 changes: 4 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { ClickerApp } from './app.component';
import { ClickerList, PagesModule, Page2 } from '../pages';
import { ClickersService, StorageService } from '../services';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

@NgModule({
declarations: [
Expand All @@ -22,6 +24,8 @@ import { ClickersService, StorageService } from '../services';
{provide: ErrorHandler, useClass: IonicErrorHandler},
ClickersService,
StorageService,
SplashScreen,
StatusBar,
],
})

Expand Down
Loading

0 comments on commit 3a8b610

Please sign in to comment.