2016-04-28 20:50:03 -04:00
|
|
|
import {UpperCasePipe} from '@angular/common';
|
2016-06-08 19:38:52 -04:00
|
|
|
import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '@angular/core/testing/testing_internal';
|
2015-05-14 13:14:26 -04:00
|
|
|
|
|
|
|
export function main() {
|
2016-06-08 19:38:52 -04:00
|
|
|
describe('UpperCasePipe', () => {
|
2016-06-08 18:45:15 -04:00
|
|
|
var upper: any /** TODO #9100 */;
|
|
|
|
var lower: any /** TODO #9100 */;
|
|
|
|
var pipe: any /** TODO #9100 */;
|
2015-05-14 13:14:26 -04:00
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
lower = 'something';
|
|
|
|
upper = 'SOMETHING';
|
|
|
|
pipe = new UpperCasePipe();
|
|
|
|
});
|
|
|
|
|
2016-06-08 19:38:52 -04:00
|
|
|
describe('transform', () => {
|
2015-05-14 13:14:26 -04:00
|
|
|
|
2016-06-08 19:38:52 -04:00
|
|
|
it('should return uppercase', () => {
|
2015-05-14 13:14:26 -04:00
|
|
|
var val = pipe.transform(lower);
|
|
|
|
expect(val).toEqual(upper);
|
|
|
|
});
|
|
|
|
|
2016-06-08 19:38:52 -04:00
|
|
|
it('should uppercase when there is a new value', () => {
|
2015-05-14 13:14:26 -04:00
|
|
|
var val = pipe.transform(lower);
|
|
|
|
expect(val).toEqual(upper);
|
|
|
|
var val2 = pipe.transform('wat');
|
|
|
|
expect(val2).toEqual('WAT');
|
|
|
|
});
|
|
|
|
|
2016-06-08 19:38:52 -04:00
|
|
|
it('should not support other objects',
|
2015-08-06 13:39:02 -04:00
|
|
|
() => { expect(() => pipe.transform(new Object())).toThrowError(); });
|
2015-05-14 13:14:26 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|