[bugfix] Display raw value in addition to ERROR (#6417)

* Display raw value in addition to ERROR

* update unit test
This commit is contained in:
Krist Wongsuphasawat
2018-11-26 10:44:42 -08:00
committed by Grace Guo
parent 7eb46843cb
commit 3c6e882d28
2 changed files with 5 additions and 6 deletions

View File

@@ -29,7 +29,7 @@ describe('utils', () => {
expect(d3format('.3s', 1234)).toBe('1.23k');
expect(d3format('.3s', 1237)).toBe('1.24k');
expect(d3format('', 1237)).toBe('1.24k');
expect(d3format('.2efd2.ef.2.e', 1237)).toBe('ERROR');
expect(d3format('.2efd2.ef.2.e', 1237)).toBe('1237 (Invalid format: .2efd2.ef.2.e)');
});
});
@@ -48,7 +48,7 @@ describe('utils', () => {
});
it('returns a working formatter', () => {
expect(d3FormatPreset('smart_date')(0)).toBe('1970');
expect(d3FormatPreset('%%GIBBERISH')(0)).toBe('ERROR');
expect(d3FormatPreset('%%GIBBERISH')(0)).toBe('0 (Invalid format: %%GIBBERISH)');
});
});