mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(e2e): popover/basic
This commit is contained in:
9
src/components/popover/test/basic/app/app.component.ts
Normal file
9
src/components/popover/test/basic/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>',
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class E2EApp {
|
||||
root = 'E2EPage';
|
||||
}
|
||||
27
src/components/popover/test/basic/app/app.module.ts
Normal file
27
src/components/popover/test/basic/app/app.module.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../..';
|
||||
|
||||
import { E2EApp } from './app.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
E2EApp,
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(E2EApp, {}, {
|
||||
links: [
|
||||
{ loadChildren: '../pages/main/main.module#E2EPageModule', name: 'E2EPage' },
|
||||
{ loadChildren: '../pages/popover-long-list-page/popover-long-list-page.module#PopoverLongListPageModule', name: 'PopoverLongListPage' },
|
||||
{ loadChildren: '../pages/popover-list-page/popover-list-page.module#PopoverListPageModule', name: 'PopoverListPage' },
|
||||
{ loadChildren: '../pages/popover-radio-page/popover-radio-page.module#PopoverRadioPageModule', name: 'PopoverRadioPage' },
|
||||
]
|
||||
})
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
E2EApp,
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
17
src/components/popover/test/basic/pages/main/main.module.ts
Normal file
17
src/components/popover/test/basic/pages/main/main.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DeepLinkModule } from '../../../../../..';
|
||||
|
||||
import { E2EPage } from './main';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
E2EPage,
|
||||
],
|
||||
imports: [
|
||||
DeepLinkModule.forChild(E2EPage)
|
||||
],
|
||||
entryComponents: [
|
||||
E2EPage,
|
||||
]
|
||||
})
|
||||
export class E2EPageModule {}
|
||||
46
src/components/popover/test/basic/pages/main/main.ts
Normal file
46
src/components/popover/test/basic/pages/main/main.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { Component, ViewChild, ElementRef } from '@angular/core';
|
||||
|
||||
import { PopoverController } from '../../../../../..';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html',
|
||||
selector: 'e2e-popover-basic'
|
||||
})
|
||||
export class E2EPage {
|
||||
@ViewChild('popoverContent', {read: ElementRef}) content: ElementRef;
|
||||
@ViewChild('popoverText', {read: ElementRef}) text: ElementRef;
|
||||
|
||||
constructor(private popoverCtrl: PopoverController) {}
|
||||
|
||||
presentListPopover(ev: UIEvent) {
|
||||
let popover = this.popoverCtrl.create('PopoverListPage');
|
||||
popover.present({
|
||||
ev: ev
|
||||
});
|
||||
}
|
||||
|
||||
presentLongListPopover(ev: UIEvent) {
|
||||
let popover = this.popoverCtrl.create('PopoverLongListPage', {}, {
|
||||
cssClass: 'my-popover popover-class'
|
||||
});
|
||||
popover.present({
|
||||
ev: ev
|
||||
});
|
||||
}
|
||||
|
||||
presentRadioPopover(ev: UIEvent) {
|
||||
let popover = this.popoverCtrl.create('PopoverRadioPage', {
|
||||
contentEle: this.content.nativeElement,
|
||||
textEle: this.text.nativeElement
|
||||
});
|
||||
|
||||
popover.present({
|
||||
ev: ev
|
||||
});
|
||||
}
|
||||
|
||||
presentNoEventPopover() {
|
||||
this.popoverCtrl.create('PopoverListPage').present();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DeepLinkModule } from '../../../../../..';
|
||||
|
||||
import { PopoverListPage } from './popover-list-page';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PopoverListPage,
|
||||
],
|
||||
imports: [
|
||||
DeepLinkModule.forChild(PopoverListPage)
|
||||
],
|
||||
entryComponents: [
|
||||
PopoverListPage,
|
||||
]
|
||||
})
|
||||
export class PopoverListPageModule {}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { ViewController } from '../../../../../..';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<ion-list style="margin-bottom: 0">
|
||||
<ion-list-header color="secondary">Ionic</ion-list-header>
|
||||
<button ion-item (click)="close()">Learn Ionic</button>
|
||||
<button ion-item (click)="close()">Documentation</button>
|
||||
</ion-list>
|
||||
<div padding style="padding-top: 0">
|
||||
<p>Paragraph text</p>
|
||||
Some more text and <span color="danger">danger span</span>.
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export class PopoverListPage {
|
||||
constructor(private viewCtrl: ViewController) {}
|
||||
|
||||
close() {
|
||||
this.viewCtrl.dismiss();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DeepLinkModule } from '../../../../../..';
|
||||
|
||||
import { PopoverLongListPage } from './popover-long-list-page';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PopoverLongListPage,
|
||||
],
|
||||
imports: [
|
||||
DeepLinkModule.forChild(PopoverLongListPage)
|
||||
],
|
||||
entryComponents: [
|
||||
PopoverLongListPage,
|
||||
]
|
||||
})
|
||||
export class PopoverLongListPageModule {}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-list-header>Ionic</ion-list-header>
|
||||
<button ion-item *ngFor="let item of items">Item {{item}}</button>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class PopoverLongListPage {
|
||||
items: number[] = [];
|
||||
|
||||
ngOnInit() {
|
||||
for (let i = 1; i < 21; i++) {
|
||||
this.items.push(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DeepLinkModule } from '../../../../../..';
|
||||
|
||||
import { PopoverRadioPage } from './popover-radio-page';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PopoverRadioPage,
|
||||
],
|
||||
imports: [
|
||||
DeepLinkModule.forChild(PopoverRadioPage)
|
||||
],
|
||||
entryComponents: [
|
||||
PopoverRadioPage,
|
||||
]
|
||||
})
|
||||
export class PopoverRadioPageModule {}
|
||||
@@ -1,7 +1,5 @@
|
||||
import { Component, ViewChild, ElementRef, ViewEncapsulation, NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule, PopoverController, NavParams, ViewController } from '../../../..';
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { NavParams } from '../../../../../..';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
@@ -136,122 +134,3 @@ export class PopoverRadioPage {
|
||||
if (this.fontFamily) this.textEle.style.fontFamily = this.fontFamily;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<ion-list style="margin-bottom: 0">
|
||||
<ion-list-header color="secondary">Ionic</ion-list-header>
|
||||
<button ion-item (click)="close()">Learn Ionic</button>
|
||||
<button ion-item (click)="close()">Documentation</button>
|
||||
</ion-list>
|
||||
<div padding style="padding-top: 0">
|
||||
<p>Paragraph text</p>
|
||||
Some more text and <span color="danger">danger span</span>.
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export class PopoverListPage {
|
||||
constructor(private viewCtrl: ViewController) {}
|
||||
|
||||
close() {
|
||||
this.viewCtrl.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-list-header>Ionic</ion-list-header>
|
||||
<button ion-item *ngFor="let item of items">Item {{item}}</button>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class PopoverLongListPage {
|
||||
items: number[] = [];
|
||||
|
||||
ngOnInit() {
|
||||
for (let i = 1; i < 21; i++) {
|
||||
this.items.push(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html',
|
||||
selector: 'e2e-popover-basic'
|
||||
})
|
||||
export class E2EPage {
|
||||
@ViewChild('popoverContent', {read: ElementRef}) content: ElementRef;
|
||||
@ViewChild('popoverText', {read: ElementRef}) text: ElementRef;
|
||||
|
||||
constructor(private popoverCtrl: PopoverController) {}
|
||||
|
||||
presentListPopover(ev: UIEvent) {
|
||||
let popover = this.popoverCtrl.create(PopoverListPage);
|
||||
popover.present({
|
||||
ev: ev
|
||||
});
|
||||
}
|
||||
|
||||
presentLongListPopover(ev: UIEvent) {
|
||||
let popover = this.popoverCtrl.create(PopoverLongListPage, {}, {
|
||||
cssClass: 'my-popover popover-class'
|
||||
});
|
||||
popover.present({
|
||||
ev: ev
|
||||
});
|
||||
}
|
||||
|
||||
presentRadioPopover(ev: UIEvent) {
|
||||
let popover = this.popoverCtrl.create(PopoverRadioPage, {
|
||||
contentEle: this.content.nativeElement,
|
||||
textEle: this.text.nativeElement
|
||||
});
|
||||
|
||||
popover.present({
|
||||
ev: ev
|
||||
});
|
||||
}
|
||||
|
||||
presentNoEventPopover() {
|
||||
this.popoverCtrl.create(PopoverListPage).present();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>',
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class E2EApp {
|
||||
root = E2EPage;
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
E2EApp,
|
||||
E2EPage,
|
||||
PopoverRadioPage,
|
||||
PopoverListPage,
|
||||
PopoverLongListPage
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(E2EApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
E2EApp,
|
||||
E2EPage,
|
||||
PopoverRadioPage,
|
||||
PopoverListPage,
|
||||
PopoverLongListPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
Reference in New Issue
Block a user