MCPcopy Create free account
hub / github.com/ampproject/amphtml / eventTest

Function eventTest

test/unit/test-viewer.js:628–642  ·  view source on GitHub ↗
(eventName)

Source from the content-addressed store, hash-verified

626
627 describe('User action makes doc visible', () => {
628 const eventTest = (eventName) => {
629 ampdoc.overrideVisibilityState('prerender');
630 viewer = new ViewerImpl(ampdoc);
631 expect(ampdoc.getVisibilityState()).to.equal('prerender');
632
633 expect(events.touchstart).to.not.be.undefined;
634 expect(events.keydown).to.not.be.undefined;
635 expect(events.mousedown).to.not.be.undefined;
636
637 events[eventName]();
638 expect(ampdoc.getVisibilityState()).to.equal('visible');
639 expect(events.touchstart).to.be.undefined;
640 expect(events.keydown).to.be.undefined;
641 expect(events.mousedown).to.be.undefined;
642 };
643
644 it(
645 'should become visible on touchstart',

Callers

nothing calls this directly

Calls 3

expectFunction · 0.85
getVisibilityStateMethod · 0.45

Tested by

no test coverage detected