function testImportForCertificateType(
        certificateType, proxyMethodName, actionEventExpected, bindBtn) {
      element.certificateType = certificateType;
      Polymer.dom.flush();

      const importButton =
          bindBtn ? element.$$('#importAndBind') : element.$$('#import');
      assertTrue(!!importButton);

      const waitForActionEvent = actionEventExpected ?
          test_util.eventToPromise(CertificateActionEvent, element) :
          Promise.resolve(null);

      MockInteractions.tap(importButton);
      return browserProxy.whenCalled(proxyMethodName)
          .then(function(arg) {
            if (proxyMethodName == 'importPersonalCertificate') {
              assertNotEquals(arg, undefined);
              assertEquals(arg, bindBtn);
            }
            return waitForActionEvent;
          })
          .then(function(event) {
            if (actionEventExpected) {
              assertEquals(CertificateAction.IMPORT, event.detail.action);
              assertEquals(certificateType, event.detail.certificateType);
            }
          });
    }
/**
     * Tests the "Import" button functionality.
     * @param {!CertificateType} certificateType
     * @param {string} proxyMethodName The name of the proxy method expected
     *     to be called.
     * @param {boolean} actionEventExpected Whether a
     *     CertificateActionEvent is expected to fire as a result tapping the
     *     Import button.
     * @param {boolean} bindBtn Whether to click on the import and bind btn.
     */
Tests the "Import" button functionality.
@param {!CertificateType} certificateType
@param {string} proxyMethodName The name of the proxy method expected
to be called.
@param {boolean} actionEventExpected Whether a
CertificateActionEvent is expected to fire as a result tapping the
Import button.
@param {boolean} bindBtn Whether to click on the import and bind btn.
Tests the " Import " button functionality . @param { !CertificateType } certificateType @param { string } proxyMethodName The name of the proxy method expected to be called . @param { boolean } actionEventExpected Whether a CertificateActionEvent is expected to fire as a result tapping the Import button . @param { boolean } bindBtn Whether to click on the import and bind btn .
function testImportForCertificateType(
        certificateType, proxyMethodName, actionEventExpected, bindBtn) {
      element.certificateType = certificateType;
      Polymer.dom.flush();
      const importButton =
          bindBtn ? element.$$('#importAndBind') : element.$$('#import');
      assertTrue(!!importButton);
      const waitForActionEvent = actionEventExpected ?
          test_util.eventToPromise(CertificateActionEvent, element) :
          Promise.resolve(null);
      MockInteractions.tap(importButton);
      return browserProxy.whenCalled(proxyMethodName)
          .then(function(arg) {
            if (proxyMethodName == 'importPersonalCertificate') {
              assertNotEquals(arg, undefined);
              assertEquals(arg, bindBtn);
            }
            return waitForActionEvent;
          })
          .then(function(event) {
            if (actionEventExpected) {
              assertEquals(CertificateAction.IMPORT, event.detail.action);
              assertEquals(certificateType, event.detail.certificateType);
            }
          });
    }
function testImportForCertificateType ( certificateType , proxyMethodName , actionEventExpected , bindBtn ) { element . certificateType = certificateType ; Polymer . dom . flush ( ) ; const importButton = bindBtn ? element . $$ ( '#importAndBind' ) : element . $$ ( '#import' ) ; assertTrue ( ! ! importButton ) ; const waitForActionEvent = actionEventExpected ? test_util . eventToPromise ( CertificateActionEvent , element ) : Promise . resolve ( null ) ; MockInteractions . tap ( importButton ) ; return browserProxy . whenCalled ( proxyMethodName ) . then ( function ( arg ) { if ( proxyMethodName == 'importPersonalCertificate' ) { assertNotEquals ( arg , undefined ) ; assertEquals ( arg , bindBtn ) ; } return waitForActionEvent ; } ) . then ( function ( event ) { if ( actionEventExpected ) { assertEquals ( CertificateAction . IMPORT , event . detail . action ) ; assertEquals ( certificateType , event . detail . certificateType ) ; } } ) ; }
Tests the "Import" button functionality.
Tests the " Import " button functionality .