コード例 #1
0
    it('correctly handles no `preferencesUrl` as service unavailable', () => {
      sinon.stub(view, 'getMarketingEmailPrefs').callsFake(() => {
        return {
          get: () => undefined
        };
      });

      view._openManagePage();

      assert.equal(view.$('.error').text().trim(), MarketingEmailErrors.toMessage('ACCOUNT_PREFS_NOT_FOUND'));
      assert.isTrue(TestHelpers.isEventLogged(metrics, 'error.settings.communication-preferences.basket-errors.13'));
    });
コード例 #2
0
 .then(function () {
   assert.equal(view.$('.error').text().trim(),
     MarketingEmailErrors.toMessage('SERVICE_UNAVAILABLE'));
   assert.isTrue(TestHelpers.isEventLogged(metrics,
     'error.settings.communication-preferences.basket-errors.99.500'));
 });