mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Handle host_hostname in query results table header (#1110)
This commit is contained in:
parent
e18f93de02
commit
602b9ea859
2 changed files with 8 additions and 4 deletions
|
|
@ -88,7 +88,7 @@ class QueryResultsTable extends Component {
|
|||
const { renderTableHeaderRowData } = this;
|
||||
const { query_results: queryResults } = campaign;
|
||||
|
||||
const queryAttrs = omit(queryResults[0], ['hostname']);
|
||||
const queryAttrs = omit(queryResults[0], ['host_hostname']);
|
||||
const queryResultColumns = keys(queryAttrs);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const host = {
|
|||
const queryResult = {
|
||||
distributed_query_execution_id: 4,
|
||||
host,
|
||||
rows: [{ cwd: '/' }],
|
||||
rows: [{ host_hostname: 'dfoihgsx', cwd: '/', directory: '/root' }],
|
||||
};
|
||||
|
||||
const campaignWithNoQueryResults = {
|
||||
|
|
@ -43,7 +43,7 @@ const campaignWithNoQueryResults = {
|
|||
const campaignWithQueryResults = {
|
||||
...campaignWithNoQueryResults,
|
||||
query_results: [
|
||||
{ hostname: host.hostname, cwd: '/' },
|
||||
{ host_hostname: 'dfoihgsx', cwd: '/', directory: '/root' },
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -77,7 +77,11 @@ describe('QueryResultsTable - component', () => {
|
|||
const tableHeaderText = componentWithQueryResults.find('thead').text();
|
||||
|
||||
queryResultKeys.forEach((key) => {
|
||||
expect(tableHeaderText).toInclude(key);
|
||||
if (key === 'host_hostname') {
|
||||
expect(tableHeaderText).toInclude('hostname');
|
||||
} else {
|
||||
expect(tableHeaderText).toInclude(key);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue