Skip to content

Commit

Permalink
add test for track by function
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyajones committed Nov 13, 2023
1 parent 42f42ea commit 57e3152
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tensorboard/webapp/runs/views/runs_table/runs_data_table_test.ts
Expand Up @@ -355,4 +355,23 @@ describe('runs_data_table', () => {

expect(onRegexFilterChangeSpy).toHaveBeenCalledWith('myRegex');
});

it('trackByRuns serializes data while ignoring color', () => {
const fixture = createComponent({});
const dataTable = fixture.debugElement.query(
By.directive(DataTableComponent)
);
expect(
dataTable.componentInstance.trackByRuns(0, {
id: 'run1',
color: 'orange',
hparam1: 1.234,
})
).toEqual(
JSON.stringify({
id: 'run1',
hparam1: 1.234,
})
);
});
});

0 comments on commit 57e3152

Please sign in to comment.