Skip to content

Commit 57e3152

Browse files
committed
add test for track by function
1 parent 42f42ea commit 57e3152

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tensorboard/webapp/runs/views/runs_table/runs_data_table_test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,4 +355,23 @@ describe('runs_data_table', () => {
355355

356356
expect(onRegexFilterChangeSpy).toHaveBeenCalledWith('myRegex');
357357
});
358+
359+
it('trackByRuns serializes data while ignoring color', () => {
360+
const fixture = createComponent({});
361+
const dataTable = fixture.debugElement.query(
362+
By.directive(DataTableComponent)
363+
);
364+
expect(
365+
dataTable.componentInstance.trackByRuns(0, {
366+
id: 'run1',
367+
color: 'orange',
368+
hparam1: 1.234,
369+
})
370+
).toEqual(
371+
JSON.stringify({
372+
id: 'run1',
373+
hparam1: 1.234,
374+
})
375+
);
376+
});
358377
});

0 commit comments

Comments
 (0)