mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fix deep-linking and added e2e tests (#140286)
* Fix deep-linking and added e2e tests * fix url check * pr suggestions
This commit is contained in:
parent
7a602e0684
commit
b8457c10de
4 changed files with 23 additions and 12 deletions
|
@ -55,4 +55,14 @@ describe('Transaction details', () => {
|
|||
.click();
|
||||
cy.url().should('include', 'opbeans-java/errors');
|
||||
});
|
||||
|
||||
describe('when navigating to a trace sample', () => {
|
||||
it('keeps the same trace sample after reloading the page', () => {
|
||||
cy.get('[data-test-subj="pagination-button-last"]').click();
|
||||
cy.url().then((url) => {
|
||||
cy.reload();
|
||||
cy.url().should('eq', url);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -22,6 +22,7 @@ import { failedTransactionsCorrelationsTab } from './failed_transactions_correla
|
|||
import { latencyCorrelationsTab } from './latency_correlations_tab';
|
||||
import { traceSamplesTab } from './trace_samples_tab';
|
||||
import { useSampleChartSelection } from '../../../hooks/use_sample_chart_selection';
|
||||
import { FETCH_STATUS } from '../../../hooks/use_fetcher';
|
||||
|
||||
const tabs = [
|
||||
traceSamplesTab,
|
||||
|
@ -69,7 +70,7 @@ export function TransactionDetailsTabs() {
|
|||
sample.transactionId === transactionId && sample.traceId === traceId
|
||||
);
|
||||
|
||||
if (!selectedSample) {
|
||||
if (traceSamplesStatus === FETCH_STATUS.SUCCESS && !selectedSample) {
|
||||
// selected sample was not found. select a new one:
|
||||
const preferredSample = maybe(traceSamples[0]);
|
||||
|
||||
|
@ -84,7 +85,7 @@ export function TransactionDetailsTabs() {
|
|||
}),
|
||||
});
|
||||
}
|
||||
}, [history, traceSamples, transactionId, traceId]);
|
||||
}, [history, traceSamples, transactionId, traceId, traceSamplesStatus]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
@ -91,12 +91,14 @@ export function WaterfallWithSummary({
|
|||
</EuiTitle>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiPagination
|
||||
pageCount={traceSamples?.length ?? 0}
|
||||
activePage={sampleActivePage}
|
||||
onPageClick={goToSample}
|
||||
compressed
|
||||
/>
|
||||
{traceSamples.length > 0 && (
|
||||
<EuiPagination
|
||||
pageCount={traceSamples.length}
|
||||
activePage={sampleActivePage}
|
||||
onPageClick={goToSample}
|
||||
compressed
|
||||
/>
|
||||
)}
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiFlexGroup justifyContent="flexEnd">
|
||||
|
|
|
@ -46,9 +46,9 @@ export function useTransactionTraceSamplesFetcher({
|
|||
status,
|
||||
error,
|
||||
} = useFetcher(
|
||||
async (callApmApi) => {
|
||||
(callApmApi) => {
|
||||
if (serviceName && start && end && transactionType && transactionName) {
|
||||
const response = await callApmApi(
|
||||
return callApmApi(
|
||||
'GET /internal/apm/services/{serviceName}/transactions/traces/samples',
|
||||
{
|
||||
params: {
|
||||
|
@ -70,8 +70,6 @@ export function useTransactionTraceSamplesFetcher({
|
|||
},
|
||||
}
|
||||
);
|
||||
|
||||
return response;
|
||||
}
|
||||
},
|
||||
// the samples should not be refetched if the transactionId or traceId changes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue