[ADF-1999] i18n support for file size pipe (#2803)

* i18n support for fileSize pipe

* remove unused declaration

* update unit test
This commit is contained in:
Denys Vuika
2018-01-05 21:26:09 +00:00
committed by Eugenio Romano
parent f9fb7dc7dd
commit e98d904363
6 changed files with 55 additions and 7 deletions

View File

@@ -22,7 +22,23 @@ describe('FileSizePipe', () => {
let pipe: FileSizePipe;
beforeEach(() => {
pipe = new FileSizePipe();
const translation: any = {
instant(key) {
const enUs = {
'CORE.FILE_SIZE.BYTES': 'Bytes',
'CORE.FILE_SIZE.KB': 'KB',
'CORE.FILE_SIZE.MB': 'MB',
'CORE.FILE_SIZE.GB': 'GB',
'CORE.FILE_SIZE.TB': 'TB',
'CORE.FILE_SIZE.PB': 'PB',
'CORE.FILE_SIZE.EB': 'EB',
'CORE.FILE_SIZE.ZB': 'ZB',
'CORE.FILE_SIZE.YB': 'YB'
};
return enUs[key];
}
};
pipe = new FileSizePipe(translation);
});
it('returns empty string with invalid input', () => {