Skip to content

Commit

Permalink
test(list): add basic e2e tests (#1876)
Browse files Browse the repository at this point in the history
Fixes #547.
  • Loading branch information
crisbeto authored and kara committed Nov 16, 2016
1 parent 435e0d9 commit 289070e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions e2e/components/list/list.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
describe('list', () => {
beforeEach(() => browser.get('/list'));

it('should render a list container', () => {
expect(element(by.css('md-list')).isPresent()).toBe(true);
});

it('should render list items inside the list container', () => {
let container = element(by.css('md-list'));
expect(container.isElementPresent(by.css('md-list-item'))).toBe(true);
});
});
2 changes: 2 additions & 0 deletions src/e2e-app/e2e-app-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {SimpleRadioButtons} from './radio/radio-e2e';
import {BasicTabs} from './tabs/tabs-e2e';
import {DialogE2E, TestDialog} from './dialog/dialog-e2e';
import {GridListE2E} from './grid-list/grid-list-e2e';
import {ListE2E} from './list/list-e2e';
import {MaterialModule} from '@angular/material';
import {E2E_APP_ROUTES} from './e2e-app/routes';

Expand All @@ -32,6 +33,7 @@ import {E2E_APP_ROUTES} from './e2e-app/routes';
DialogE2E,
TestDialog,
GridListE2E,
ListE2E,
],
bootstrap: [E2EApp],
providers: [
Expand Down
1 change: 1 addition & 0 deletions src/e2e-app/e2e-app/e2e-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<a md-list-item [routerLink]="['dialog']">Dialog</a>
<a md-list-item [routerLink]="['grid-list']">Grid list</a>
<a md-list-item [routerLink]="['icon']">Icon</a>
<a md-list-item [routerLink]="['list']">List</a>
<a md-list-item [routerLink]="['menu']">Menu</a>
<a md-list-item [routerLink]="['radio']">Radios</a>
<a md-list-item [routerLink]="['tabs']">Tabs</a>
Expand Down
2 changes: 2 additions & 0 deletions src/e2e-app/e2e-app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {SimpleRadioButtons} from '../radio/radio-e2e';
import {SimpleCheckboxes} from '../checkbox/checkbox-e2e';
import {DialogE2E} from '../dialog/dialog-e2e';
import {GridListE2E} from '../grid-list/grid-list-e2e';
import {ListE2E} from '../list/list-e2e';

export const E2E_APP_ROUTES: Routes = [
{path: '', component: Home},
Expand All @@ -19,4 +20,5 @@ export const E2E_APP_ROUTES: Routes = [
{path: 'tabs', component: BasicTabs},
{path: 'dialog', component: DialogE2E},
{path: 'grid-list', component: GridListE2E},
{path: 'list', component: ListE2E},
];
5 changes: 5 additions & 0 deletions src/e2e-app/list/list-e2e.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<md-list>
<h3 md-subheader>Items</h3>
<md-list-item>Item one</md-list-item>
<md-list-item>Item two</md-list-item>
</md-list>
9 changes: 9 additions & 0 deletions src/e2e-app/list/list-e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {Component} from '@angular/core';


@Component({
moduleId: module.id,
selector: 'list-e2e',
templateUrl: 'list-e2e.html',
})
export class ListE2E {}

0 comments on commit 289070e

Please sign in to comment.