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', () => {
|
||||
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');
|
||||
}
|
||||
|
||||
getTitle() {
|
||||
getTitleText() {
|
||||
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
|
||||
</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>
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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() {
|
||||
}
|
||||
|
||||
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 { 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 {}
|
||||
|
||||
Reference in New Issue
Block a user