Skip to content

Commit 5b49963

Browse files
committed
add test for track by function
1 parent 42f42ea commit 5b49963

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,4 +355,21 @@ 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(By.directive(RunsDataTable));
362+
expect(
363+
dataTable.componentInstance.trackByRuns(0, {
364+
id: 'run1',
365+
color: 'orange',
366+
hparam1: 1.234,
367+
})
368+
).toEqual(
369+
JSON.stringify({
370+
id: 'run1',
371+
hparam1: 1.234,
372+
})
373+
);
374+
});
358375
});

0 commit comments

Comments
 (0)