|
@@ -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();
|
|
|
|