MCPcopy
hub / github.com/ampproject/amphtml / waitForData

Function waitForData

extensions/amp-list/1.0/test/test-component.js:26–35  ·  view source on GitHub ↗
(component, callCount = 1)

Source from the content-addressed store, hash-verified

24 });
25
26 async function waitForData(component, callCount = 1) {
27 await waitFor(
28 () => fetchJson.callCount === callCount,
29 'expected fetchJson to have been called' +
30 (callCount > 1 ? ` ${callCount} times` : '')
31 );
32 // Ensure everything has settled:
33 await macroTask();
34 component.update();
35 }
36
37 describe('default behavior', () => {
38 it('should render a "loading" state first', async () => {

Callers 1

test-component.jsFile · 0.85

Calls 3

waitForFunction · 0.90
macroTaskFunction · 0.90
updateMethod · 0.45

Tested by

no test coverage detected