mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
feat(demo): lay out the demo inputs page
This commit is contained in:
@ -9,6 +9,14 @@ describe('Demo Inputs Page', () => {
|
|||||||
|
|
||||||
it('should display title', () => {
|
it('should display title', () => {
|
||||||
page.navigateTo();
|
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');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,7 +5,15 @@ export class InputsPage {
|
|||||||
return browser.get('/inputs');
|
return browser.get('/inputs');
|
||||||
}
|
}
|
||||||
|
|
||||||
getTitle() {
|
getTitleText() {
|
||||||
return element(by.css('.title')).getText();
|
return element(by.css('.title')).getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getInputOne() {
|
||||||
|
return element(by.id('inputOne'));
|
||||||
|
}
|
||||||
|
|
||||||
|
getOutputOneText() {
|
||||||
|
return element(by.id('outputOne')).getText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,4 +2,15 @@
|
|||||||
Ionic Core Inputs Demo
|
Ionic Core Inputs Demo
|
||||||
</div>
|
</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>
|
<a href='home'>Home</a>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { InputsTestPageComponent } from './inputs-test-page.component';
|
import { InputsTestPageComponent } from './inputs-test-page.component';
|
||||||
@ -6,12 +7,14 @@ describe('InputsTestPageComponent', () => {
|
|||||||
let component: InputsTestPageComponent;
|
let component: InputsTestPageComponent;
|
||||||
let fixture: ComponentFixture<InputsTestPageComponent>;
|
let fixture: ComponentFixture<InputsTestPageComponent>;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(
|
||||||
TestBed.configureTestingModule({
|
async(() => {
|
||||||
declarations: [ InputsTestPageComponent ]
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [InputsTestPageComponent],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||||
|
}).compileComponents();
|
||||||
})
|
})
|
||||||
.compileComponents();
|
);
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(InputsTestPageComponent);
|
fixture = TestBed.createComponent(InputsTestPageComponent);
|
||||||
|
|||||||
@ -7,10 +7,9 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class InputsTestPageComponent implements OnInit {
|
export class InputsTestPageComponent implements OnInit {
|
||||||
|
testInputOne = 'This is data for test input one';
|
||||||
|
|
||||||
constructor() { }
|
constructor() {}
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ngOnInit() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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 { CommonModule } from '@angular/common';
|
||||||
import { InputsTestPageComponent } from './inputs-test-page.component';
|
import { InputsTestPageComponent } from './inputs-test-page.component';
|
||||||
|
|
||||||
import { InputsRoutingModule } from './inputs-routing.module';
|
import { InputsRoutingModule } from './inputs-routing.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [CommonModule, FormsModule, InputsRoutingModule],
|
||||||
CommonModule,
|
declarations: [InputsTestPageComponent],
|
||||||
InputsRoutingModule
|
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||||
],
|
|
||||||
declarations: [InputsTestPageComponent]
|
|
||||||
})
|
})
|
||||||
export class InputsModule { }
|
export class InputsModule {}
|
||||||
|
|||||||
Reference in New Issue
Block a user