-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
103 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
it('should unify buttons', function() { | ||
element(by.css('.e2eButtonDynamicUnify')).click(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {App, IonicApp} from 'ionic-angular'; | ||
|
||
|
||
@App({ | ||
templateUrl: 'main.html' | ||
}) | ||
class E2EApp { | ||
isDestructive: boolean; | ||
isSecondary: boolean; | ||
isCustom: boolean; | ||
isOutline: boolean; | ||
isClear: boolean; | ||
isClicked: boolean; | ||
myColor1: string; | ||
myColor2: string; | ||
multiColor: Array<string>; | ||
|
||
constructor() { | ||
this.reset(); | ||
} | ||
|
||
unify() { | ||
this.isDestructive = false; | ||
this.isSecondary = false; | ||
this.isCustom = false; | ||
this.isOutline = false; | ||
this.isClear = false; | ||
this.isClicked = false; | ||
this.myColor1 = 'primary'; | ||
this.myColor2 = 'primary'; | ||
this.multiColor = ['primary']; | ||
} | ||
|
||
reset() { | ||
this.isDestructive = true; | ||
this.isSecondary = true; | ||
this.isCustom = true; | ||
this.isOutline = true; | ||
this.isClear = true; | ||
this.isClicked = false; | ||
this.myColor1 = 'custom1'; | ||
this.myColor2 = 'custom2'; | ||
this.multiColor = ['primary','secondary']; | ||
} | ||
|
||
toggle() { | ||
this.isClicked = !this.isClicked; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
<ion-toolbar> | ||
<ion-title>Default Buttons</ion-title> | ||
</ion-toolbar> | ||
|
||
<ion-content padding text-center> | ||
<h1>Button Attributes Test</h1> | ||
<button block>Primary</button> | ||
<button block [color]="isDestructive ? 'danger' : 'primary'" [outline]="isOutline">Danger (Outline)</button> | ||
<button block [color]="isSecondary ? 'secondary' : 'primary'" [clear]="isClear">Secondary (Clear)</button> | ||
<button block [color]="myColor1" [round]="isCustom">Custom #1</button> | ||
<button block [color]="myColor2" [outline]="isOutline" [round]="isCustom">Custom #2 (Outline)</button> | ||
<button block primary light [clear]="isClear" [round]="isCustom">Multicolor (Clear)</button> | ||
<button block danger dark [outline]="isOutline" [round]="isCustom">Multicolor (Outline)</button> | ||
<button block [color]="multiColor" [solid]="!isClicked" [outline]="isClicked" [round]="isCustom" (click)="toggle()">Multicolor (Toggle)</button> | ||
<hr/> | ||
<button block outline danger (click)="unify()" class="e2eButtonDynamicUnify">Unify all buttons</button> | ||
<button block clear danger (click)="reset()">Reset all buttons</button> | ||
</ion-content> |