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

Function listTests

test/integration/test-amp-bind.js:262–290  ·  view source on GitHub ↗
(env)

Source from the content-addressed store, hash-verified

260 `;
261
262 const listTests = (env) => {
263 let doc;
264 let list;
265 let browser;
266
267 beforeEach(() => {
268 doc = env.win.document;
269 list = doc.querySelector('amp-list');
270 browser = new BrowserController(env.win);
271 });
272
273 it('[src]', async () => {
274 expect(list.getAttribute('src')).to.equal('/list/fruit-data/get?cors=0');
275 browser.click('button');
276 await poll(
277 '[src]',
278 () => list.getAttribute('src') === 'https://example.com/data'
279 ).should.be.fulfilled;
280 });
281
282 it('evaluate bindings in children', async () => {
283 await browser.waitForElementLayout('amp-list');
284 const children = list.querySelectorAll('p');
285 expect(children.length).to.equal(3);
286 children.forEach((span) => {
287 expect(span.textContent).to.equal('123');
288 });
289 });
290 };
291
292 describes.integration(
293 '+ amp-list, amp-mustache:0.1',

Callers

nothing calls this directly

Calls 8

pollFunction · 0.90
beforeEachFunction · 0.85
expectFunction · 0.85
getAttributeMethod · 0.80
waitForElementLayoutMethod · 0.80
itFunction · 0.50
clickMethod · 0.45
forEachMethod · 0.45

Tested by

no test coverage detected