[Controls] Pause fetch until initialized#239228
Conversation
|
/ci |
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
|
@elasticmachine merge upstream |
| getReferences.mockClear(); | ||
| }); | ||
|
|
||
| it('should return default state when no initial state is provided', () => { |
There was a problem hiding this comment.
How about breaking this file into blocks with a few describes. For instance, this test and next should be in a describe block for getStateForControlGroup
| expect(api.controlGroupApi$.value).toBe(mockControlGroupApi); | ||
| }); | ||
|
|
||
| it('should serialize control group state', () => { |
There was a problem hiding this comment.
How about moving this test and the next into a describe block for serializeControlGroup
src/platform/plugins/shared/dashboard/public/dashboard_api/control_group_manager.ts
Show resolved
Hide resolved
src/platform/plugins/shared/dashboard/public/dashboard_api/control_group_manager.ts
Show resolved
Hide resolved
|
I'm not sure how far we want to go with testing, but I'll share here a way to check the runtime request count in a Scout functional test in case it is helpful: test('request count', async ({ page, context }) => {
const cdp = await context.newCDPSession(page);
await cdp.send('Network.enable');
cdp.on('Network.requestWillBeSent', (event) => { // doc: https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-requestWillBeSent
if (/* check event.request.url */) {
// count requests
}
});
// load page and wait for something relevant
// assert
});(from #237949 (comment)) |
|
Thanks for the snippet @drewdaemon! It's a great idea to write this kind of scout test, but I'd prefer to do so in a followup if that is okay for you! |
|
@ThomThomson ++ definitely not a blocker, just a flyby advertisement 😁 |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
|
nreese
left a comment
There was a problem hiding this comment.
kibana-presentation changes LGTM
code review and tested in chrome
Summary
This PR changes the Dashboard to render all of its panels at once - even when the control group is not initialized.
To prevent double refetches the rendered panels will have their fetches paused until all controls and their initial values are ready.
How to test
eserequest in the network tab.