Commit 5d166dc8 by Torkel Ödegaard

feat(tablepanel): added new renderer spec

parent b8e6fcfe
......@@ -48,6 +48,10 @@ export class TableRenderer {
return '-';
}
if (_.isString(v)) {
return v;
}
if (style.colorMode) {
this.colorState[style.colorMode] = this.getColorForValue(v, style);
}
......
......@@ -50,6 +50,11 @@ describe('when rendering table', () => {
expect(html).to.be('<td>1.230 s</td>');
});
it('number style should ignore string values', () => {
var html = renderer.renderCell(1, 'asd');
expect(html).to.be('<td>asd</td>');
});
it('colored cell should have style', () => {
var html = renderer.renderCell(2, 55);
expect(html).to.be('<td style="color:orange">55.0</td>');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment