refactor (test/services): Ts'ifying test/services

Translates AtScript files in test/services to TypeScript

Closes #2193
This commit is contained in:
Ian Riley
2015-05-27 13:48:24 -07:00
committed by Tobias Bosch
parent c065fb1422
commit 8ce0a67c81
8 changed files with 138 additions and 133 deletions

View File

@ -0,0 +1,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('');
});
});
}