Skip to content

Commit b61811a

Browse files
ktranDevtools-frontend LUCI CQ
authored andcommitted
Add test for ReportsAPI tab in Application Panel
This test makes sure that we show both reports and endpoints. Bug: 325443331 Change-Id: I6b07dcd70b5fa7f74e315cf962c8c0745ae1d67e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6250601 Commit-Queue: Kim-Anh Tran <[email protected]> Auto-Submit: Kim-Anh Tran <[email protected]> Reviewed-by: Kateryna Prokopenko <[email protected]>
1 parent 322a501 commit b61811a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

front_end/panels/application/ReportingApiView.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import * as SDK from '../../core/sdk/sdk.js';
66
import {createTarget} from '../../testing/EnvironmentHelpers.js';
77
import {describeWithMockConnection} from '../../testing/MockConnection.js';
8+
import * as UI from '../../ui/legacy/legacy.js';
89

910
import * as Application from './application.js';
1011
import * as ApplicationComponents from './components/components.js';
@@ -36,4 +37,16 @@ describeWithMockConnection('ReportingApiView', () => {
3637
sinon.assert.calledWith(
3738
endpointsGridData.set, {endpoints: new Map([[ORIGIN_1, ENDPOINTS_1], [ORIGIN_2, ENDPOINTS_2]])});
3839
});
40+
41+
it('shows reports (main element) and endpoints (sidebar element)', () => {
42+
const target = createTarget();
43+
const networkManager = target.model(SDK.NetworkManager.NetworkManager);
44+
assert.exists(networkManager);
45+
const endpointsGrid = new ApplicationComponents.EndpointsGrid.EndpointsGrid();
46+
const view = new Application.ReportingApiView.ReportingApiView(endpointsGrid);
47+
48+
assert.isTrue(view.showMode() === UI.SplitWidget.ShowMode.BOTH);
49+
assert.isNotNull(view.mainWidget());
50+
assert.isNotNull(view.sidebarElement());
51+
});
3952
});

0 commit comments

Comments
 (0)