From 82d0bde0e222d2f4c56655682f351474040f62b4 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Wed, 9 Nov 2016 14:07:50 -0500 Subject: [PATCH] test(button): add test for anchor buttons, update basic test references #8293 --- .../button/test/anchors/app-module.ts | 46 ++++++++++++++++ src/components/button/test/anchors/e2e.ts | 1 + src/components/button/test/anchors/main.html | 52 +++++++++++++++++++ src/components/button/test/basic/main.html | 2 +- 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 src/components/button/test/anchors/app-module.ts create mode 100644 src/components/button/test/anchors/e2e.ts create mode 100644 src/components/button/test/anchors/main.html diff --git a/src/components/button/test/anchors/app-module.ts b/src/components/button/test/anchors/app-module.ts new file mode 100644 index 0000000000..bd7e2c8fe3 --- /dev/null +++ b/src/components/button/test/anchors/app-module.ts @@ -0,0 +1,46 @@ +import { NgModule, Component } from '@angular/core'; +import { IonicApp, IonicModule, App } from '../../../..'; + + +@Component({ + templateUrl: 'main.html' +}) +export class E2EPage { + btnColor: string; + testingColors = ['primary', 'secondary', 'danger', 'dark']; + testingColorIndex = 0; + + constructor(app: App) { + app.setTitle('Basic Buttons'); + this.chgColor(); + } + + chgColor() { + this.btnColor = this.testingColors[this.testingColorIndex]; + console.log('dynamic btnColor', this.btnColor); + this.testingColorIndex = (this.testingColorIndex >= this.testingColors.length - 1 ? 0 : this.testingColorIndex + 1); + } +} + +@Component({ + template: '' +}) +export class E2EApp { + rootPage = E2EPage; +} + + +@NgModule({ + declarations: [ + E2EApp, + E2EPage + ], + imports: [ + IonicModule.forRoot(E2EApp) + ], + bootstrap: [IonicApp], + entryComponents: [ + E2EPage + ] +}) +export class AppModule {} diff --git a/src/components/button/test/anchors/e2e.ts b/src/components/button/test/anchors/e2e.ts new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/components/button/test/anchors/e2e.ts @@ -0,0 +1 @@ + diff --git a/src/components/button/test/anchors/main.html b/src/components/button/test/anchors/main.html new file mode 100644 index 0000000000..20aa4b626b --- /dev/null +++ b/src/components/button/test/anchors/main.html @@ -0,0 +1,52 @@ + + + + Anchor Buttons + + + + + + + +

+ Default + Default.activated +

+ +

+ Primary + Primary.activated +

+ +

+ Secondary + Secondary.activated +

+ +

+ Danger + Danger.activated +

+ +

+ Light + Light.activated +

+ +

+ Dark + Dark.activated +

+ +

+ A Disabled + Secondary Disabled +

+ +

+ Change Color + Change Color +

+ +
diff --git a/src/components/button/test/basic/main.html b/src/components/button/test/basic/main.html index 25b65cb603..fb43c2b423 100644 --- a/src/components/button/test/basic/main.html +++ b/src/components/button/test/basic/main.html @@ -41,7 +41,7 @@

- A Disabled +