removed fdescribe + refactor
This commit is contained in:
parent
56ab95ee73
commit
e467a517fe
|
@ -1,4 +1,4 @@
|
||||||
fdescribe('Currency filter', () => {
|
describe('Currency filter', () => {
|
||||||
let compile;
|
let compile;
|
||||||
let $element;
|
let $element;
|
||||||
|
|
||||||
|
@ -11,17 +11,31 @@ fdescribe('Currency filter', () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
it('should return the value formatted with two decimals when the value is a number and you set it a 2 as param', () => {
|
it('should return a ONE decimal number as per the argument', () => {
|
||||||
|
let html = `<div id="test" >{{200 | currency: '€': 1}}</div>`;
|
||||||
|
compile(html);
|
||||||
|
|
||||||
|
expect($element[0].innerHTML).toEqual('200.0 €');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return a TWO decimals number as per the argument', () => {
|
||||||
let html = `<div id="test" >{{200 | currency: '€': 2}}</div>`;
|
let html = `<div id="test" >{{200 | currency: '€': 2}}</div>`;
|
||||||
compile(html);
|
compile(html);
|
||||||
|
|
||||||
expect($element[0].innerHTML).toBe('200.00 €');
|
expect($element[0].innerHTML).toEqual('200.00 €');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return a TEN decimals number as per the argument', () => {
|
||||||
|
let html = `<div id="test" >{{200 | currency: '€': 10}}</div>`;
|
||||||
|
compile(html);
|
||||||
|
|
||||||
|
expect($element[0].innerHTML).toEqual('200.0000000000 €');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('sould return nothing when the value is not set', () => {
|
it('sould return nothing when the value is not set', () => {
|
||||||
let html = `<div id="test" >{{null | currency: '€': 2}}</div>`;
|
let html = `<div id="test" >{{null | currency: '€': 2}}</div>`;
|
||||||
compile(html);
|
compile(html);
|
||||||
|
|
||||||
expect($element[0].innerHTML).toBe('');
|
expect($element[0].innerHTML).toEqual('');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue