Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Location} from 'history';

import _EventsRequest from 'app/components/charts/eventsRequest';
import {getInterval} from 'app/components/charts/utils';
import EmptyStateWarning from 'app/components/emptyStateWarning';
import Link from 'app/components/links/link';
import Tooltip from 'app/components/tooltip';
import Truncate from 'app/components/truncate';
Expand Down Expand Up @@ -181,6 +182,9 @@ export function LineChartListWidget(props: Props) {
HeaderActions={provided => (
<ContainerActions isLoading={provided.widgetData.list?.isLoading} />
)}
EmptyComponent={() => (
<StyledEmptyStateWarning small>{t('No results')}</StyledEmptyStateWarning>
)}
Queries={Queries}
Visualizations={[
{
Expand Down Expand Up @@ -319,3 +323,8 @@ const StyledIconClose = styled(IconClose)`
color: ${p => p.theme.gray300};
}
`;

const StyledEmptyStateWarning = styled(EmptyStateWarning)`
min-height: 300px;
justify-content: center;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,48 @@ describe('Performance > Widgets > WidgetContainer', function () {
);
});

it('Most slow frames widget', async function () {
const data = initializeData();

const wrapper = mountWithTheme(
<WrappedComponent
data={data}
defaultChartSetting={PerformanceWidgetSetting.MOST_SLOW_FRAMES}
/>,
data.routerContext
);
await tick();
wrapper.update();

expect(wrapper.find('div[data-test-id="performance-widget-title"]').text()).toEqual(
'Most Slow Frames'
);

expect(eventsV2Mock).toHaveBeenCalledTimes(1);
expect(eventsV2Mock).toHaveBeenNthCalledWith(
1,
expect.anything(),
expect.objectContaining({
query: expect.objectContaining({
environment: [],
field: [
'transaction',
'project.id',
'epm()',
'p75(measurements.frames_slow_rate)',
],
per_page: 3,
project: [],
query: 'epm():>0.01 p75(measurements.frames_slow_rate):>0',
sort: '-p75(measurements.frames_slow_rate)',
statsPeriod: '14d',
}),
})
);

expect(wrapper.find('div[data-test-id="empty-message"]').exists()).toBe(true);
});

it('Able to change widget type from menu', async function () {
const data = initializeData();

Expand Down