feat(demo): lay out the demo inputs page

This commit is contained in:
Ken Sodemann
2017-11-15 06:24:22 -06:00
parent 98302fe938
commit 293b756453
6 changed files with 46 additions and 18 deletions

View File

@ -9,6 +9,14 @@ describe('Demo Inputs Page', () => {
it('should display title', () => {
page.navigateTo();
expect(page.getTitle()).toEqual('Ionic Core Inputs Demo');
expect(page.getTitleText()).toEqual('Ionic Core Inputs Demo');
});
describe('input one', () => {
it('should display the starting text', () => {
page.navigateTo();
const el = page.getInputOne();
expect(el.getAttribute('value')).toEqual('This is data for test input one');
});
});
});

View File

@ -5,7 +5,15 @@ export class InputsPage {
return browser.get('/inputs');
}
getTitle() {
getTitleText() {
return element(by.css('.title')).getText();
}
getInputOne() {
return element(by.id('inputOne'));
}
getOutputOneText() {
return element(by.id('outputOne')).getText();
}
}

View File

@ -2,4 +2,15 @@
Ionic Core Inputs Demo
</div>
<ion-grid>
<ion-row>
<ion-col>
<ion-input id="inputOne" [(ngModel)]="testInputOne" ngDefaultControl></ion-input>
</ion-col>
<ion-col>
Entered Data: <span id="outputOne">{{testInputOne}}</span>
</ion-col>
</ion-row>
</ion-grid>
<a href='home'>Home</a>

View File

@ -1,3 +1,4 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { InputsTestPageComponent } from './inputs-test-page.component';
@ -6,12 +7,14 @@ describe('InputsTestPageComponent', () => {
let component: InputsTestPageComponent;
let fixture: ComponentFixture<InputsTestPageComponent>;
beforeEach(async(() => {
beforeEach(
async(() => {
TestBed.configureTestingModule({
declarations: [ InputsTestPageComponent ]
declarations: [InputsTestPageComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
}).compileComponents();
})
.compileComponents();
}));
);
beforeEach(() => {
fixture = TestBed.createComponent(InputsTestPageComponent);

View File

@ -7,10 +7,9 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core';
encapsulation: ViewEncapsulation.None
})
export class InputsTestPageComponent implements OnInit {
testInputOne = 'This is data for test input one';
constructor() { }
ngOnInit() {
}
constructor() {}
ngOnInit() {}
}

View File

@ -1,14 +1,13 @@
import { NgModule } from '@angular/core';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { InputsTestPageComponent } from './inputs-test-page.component';
import { InputsRoutingModule } from './inputs-routing.module';
@NgModule({
imports: [
CommonModule,
InputsRoutingModule
],
declarations: [InputsTestPageComponent]
imports: [CommonModule, FormsModule, InputsRoutingModule],
declarations: [InputsTestPageComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class InputsModule { }
export class InputsModule {}