Skip to content

Commit 9bac9e0

Browse files
committed
test(list): add basic e2e tests
Adds basic sanity check e2e tests for the list component. Fixes #547.
1 parent 607de8f commit 9bac9e0

File tree

6 files changed

+31
-0
lines changed

6 files changed

+31
-0
lines changed

e2e/components/list/list.e2e.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
describe('list', () => {
2+
beforeEach(() => browser.get('/list'));
3+
4+
it('should render a list container', () => {
5+
expect(element(by.css('md-list')).isPresent()).toBe(true);
6+
});
7+
8+
it('should render list items inside the list container', () => {
9+
let container = element(by.css('md-list'));
10+
expect(container.isElementPresent(by.css('md-list-item'))).toBe(true);
11+
});
12+
});

src/e2e-app/e2e-app-module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {MenuE2E} from './menu/menu-e2e';
99
import {SimpleRadioButtons} from './radio/radio-e2e';
1010
import {BasicTabs} from './tabs/tabs-e2e';
1111
import {DialogE2E, TestDialog} from './dialog/dialog-e2e';
12+
import {ListE2E} from './list/list-e2e';
1213
import {MaterialModule} from '@angular/material';
1314
import {E2E_APP_ROUTES} from './e2e-app/routes';
1415

@@ -30,6 +31,7 @@ import {E2E_APP_ROUTES} from './e2e-app/routes';
3031
Home,
3132
DialogE2E,
3233
TestDialog,
34+
ListE2E,
3335
],
3436
bootstrap: [E2EApp],
3537
providers: [

src/e2e-app/e2e-app/e2e-app.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<a md-list-item [routerLink]="['checkbox']">Checkbox</a>
33
<a md-list-item [routerLink]="['dialog']">Dialog</a>
44
<a md-list-item [routerLink]="['icon']">Icon</a>
5+
<a md-list-item [routerLink]="['list']">List</a>
56
<a md-list-item [routerLink]="['menu']">Menu</a>
67
<a md-list-item [routerLink]="['radio']">Radios</a>
78
<a md-list-item [routerLink]="['tabs']">Tabs</a>

src/e2e-app/e2e-app/routes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {MenuE2E} from '../menu/menu-e2e';
77
import {SimpleRadioButtons} from '../radio/radio-e2e';
88
import {SimpleCheckboxes} from '../checkbox/checkbox-e2e';
99
import {DialogE2E} from '../dialog/dialog-e2e';
10+
import {ListE2E} from '../list/list-e2e';
1011

1112
export const E2E_APP_ROUTES: Routes = [
1213
{path: '', component: Home},
@@ -17,4 +18,5 @@ export const E2E_APP_ROUTES: Routes = [
1718
{path: 'radio', component: SimpleRadioButtons},
1819
{path: 'tabs', component: BasicTabs},
1920
{path: 'dialog', component: DialogE2E},
21+
{path: 'list', component: ListE2E},
2022
];

src/e2e-app/list/list-e2e.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<md-list>
2+
<h3 md-subheader>Items</h3>
3+
<md-list-item>Item one</md-list-item>
4+
<md-list-item>Item two</md-list-item>
5+
</md-list>

src/e2e-app/list/list-e2e.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {Component} from '@angular/core';
2+
3+
4+
@Component({
5+
moduleId: module.id,
6+
selector: 'list-e2e',
7+
templateUrl: 'list-e2e.html',
8+
})
9+
export class ListE2E {}

0 commit comments

Comments
 (0)