2015-10-13 03:29:13 -04:00
|
|
|
import {
|
|
|
|
ddescribe,
|
|
|
|
describe,
|
|
|
|
it,
|
|
|
|
iit,
|
|
|
|
xit,
|
|
|
|
expect,
|
|
|
|
beforeEach,
|
|
|
|
afterEach
|
|
|
|
} from 'angular2/testing_internal';
|
2015-05-14 13:14:26 -04:00
|
|
|
|
2015-11-18 18:55:43 -05:00
|
|
|
import {UpperCasePipe} from 'angular2/common';
|
2015-05-14 13:14:26 -04:00
|
|
|
|
|
|
|
export function main() {
|
|
|
|
describe("UpperCasePipe", () => {
|
|
|
|
var upper;
|
|
|
|
var lower;
|
|
|
|
var pipe;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
lower = 'something';
|
|
|
|
upper = 'SOMETHING';
|
|
|
|
pipe = new UpperCasePipe();
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("transform", () => {
|
|
|
|
|
|
|
|
it("should return uppercase", () => {
|
|
|
|
var val = pipe.transform(lower);
|
|
|
|
expect(val).toEqual(upper);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should uppercase when there is a new value", () => {
|
|
|
|
var val = pipe.transform(lower);
|
|
|
|
expect(val).toEqual(upper);
|
|
|
|
var val2 = pipe.transform('wat');
|
|
|
|
expect(val2).toEqual('WAT');
|
|
|
|
});
|
|
|
|
|
2015-08-06 13:39:02 -04:00
|
|
|
it("should not support other objects",
|
|
|
|
() => { expect(() => pipe.transform(new Object())).toThrowError(); });
|
2015-05-14 13:14:26 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|