forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtitle_spec.ts
More file actions
28 lines (21 loc) · 899 Bytes
/
title_spec.ts
File metadata and controls
28 lines (21 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import {ddescribe, describe, it, iit, xit, expect, afterEach} from 'angular2/test_lib';
import {DOM} from 'angular2/src/dom/dom_adapter';
import {Title} from 'angular2/src/services/title';
export function main() {
describe('title service', () => {
var initialTitle = DOM.getTitle();
var titleService = new Title();
afterEach(() => { DOM.setTitle(initialTitle); });
it('should allow reading initial title',
() => { expect(titleService.getTitle()).toEqual(initialTitle); });
it('should set a title on the injected document', () => {
titleService.setTitle('test title');
expect(DOM.getTitle()).toEqual('test title');
expect(titleService.getTitle()).toEqual('test title');
});
it('should reset title to empty string if title not provided', () => {
titleService.setTitle(null);
expect(DOM.getTitle()).toEqual('');
});
});
}