2016-04-12 12:40:37 -04:00
|
|
|
import {
|
|
|
|
ddescribe,
|
|
|
|
describe,
|
|
|
|
it,
|
|
|
|
iit,
|
|
|
|
xit,
|
|
|
|
expect,
|
|
|
|
beforeEach,
|
|
|
|
afterEach
|
2016-04-28 20:50:03 -04:00
|
|
|
} from '@angular/core/testing/testing_internal';
|
2015-05-14 13:14:26 -04:00
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
import {LowerCasePipe} from '@angular/common';
|
2015-05-14 13:14:26 -04:00
|
|
|
|
|
|
|
export function main() {
|
2016-04-12 12:40:37 -04:00
|
|
|
describe("LowerCasePipe", () => {
|
2015-05-14 13:14:26 -04:00
|
|
|
var upper;
|
|
|
|
var lower;
|
|
|
|
var pipe;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
lower = 'something';
|
|
|
|
upper = 'SOMETHING';
|
|
|
|
pipe = new LowerCasePipe();
|
|
|
|
});
|
|
|
|
|
2016-04-12 12:40:37 -04:00
|
|
|
describe("transform", () => {
|
|
|
|
it("should return lowercase", () => {
|
2015-05-14 13:14:26 -04:00
|
|
|
var val = pipe.transform(upper);
|
|
|
|
expect(val).toEqual(lower);
|
|
|
|
});
|
|
|
|
|
2016-04-12 12:40:37 -04:00
|
|
|
it("should lowercase when there is a new value", () => {
|
2015-05-14 13:14:26 -04:00
|
|
|
var val = pipe.transform(upper);
|
|
|
|
expect(val).toEqual(lower);
|
|
|
|
var val2 = pipe.transform('WAT');
|
|
|
|
expect(val2).toEqual('wat');
|
|
|
|
});
|
|
|
|
|
2016-04-12 12:40:37 -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
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|