Skip to content

Commit

Permalink
simplify test
Browse files Browse the repository at this point in the history
Simplify test
  • Loading branch information
sorenlouv committed Nov 26, 2020
1 parent 1917831 commit 20bd7fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function ServiceOverviewThroughputChart({
const { transactionType } = useApmService();
const { start, end } = urlParams;

const { data = { throughput: [] }, status } = useFetcher(() => {
const { data, status } = useFetcher(() => {
if (serviceName && transactionType && start && end) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/throughput',
Expand All @@ -45,7 +45,6 @@ export function ServiceOverviewThroughputChart({
});
}
}, [serviceName, start, end, uiFilters, transactionType]);
const { throughput } = data;

return (
<EuiPanel>
Expand All @@ -63,7 +62,7 @@ export function ServiceOverviewThroughputChart({
fetchStatus={status}
timeseries={[
{
data: throughput,
data: data.throughput ?? [],
type: 'linemark',
color: theme.eui.euiColorVis0,
title: i18n.translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ function setup({
urlParams: IUrlParams;
serviceTransactionTypes: string[];
}) {
const defaultLocation = {
history.replace({
pathname: '/services/foo/transactions',
search: fromQuery(urlParams),
} as any;

history.replace({
...defaultLocation,
});

// mock transaction types
Expand Down

0 comments on commit 20bd7fc

Please sign in to comment.