mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(tablepanel): added new renderer spec
This commit is contained in:
parent
b8e6fcfeae
commit
5d166dc8cb
@ -48,6 +48,10 @@ export class TableRenderer {
|
|||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_.isString(v)) {
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
if (style.colorMode) {
|
if (style.colorMode) {
|
||||||
this.colorState[style.colorMode] = this.getColorForValue(v, style);
|
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>');
|
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', () => {
|
it('colored cell should have style', () => {
|
||||||
var html = renderer.renderCell(2, 55);
|
var html = renderer.renderCell(2, 55);
|
||||||
expect(html).to.be('<td style="color:orange">55.0</td>');
|
expect(html).to.be('<td style="color:orange">55.0</td>');
|
||||||
|
Loading…
Reference in New Issue
Block a user