How to use the fluxible/utils.createMockActionContext function in fluxible

To help you get started, we’ve selected a few fluxible examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github localnerve / flux-react-example / tests / unit / actions / size.js View on Github external
beforeEach(function () {
    context = createMockActionContext({
      stores: [ BackgroundStore ]
    });
  });
github localnerve / flux-react-example / tests / unit / actions / page.js View on Github external
beforeEach(function () {
    calledService = 0;
    context = createMockActionContext({
      stores: [ApplicationStore, ContentStore]
    });
    context.service = new MockService();
    context.service.setService('page', function (method, params, config, callback) {
      calledService++;
      serviceData.fetch(params, callback);
    });
  });
github localnerve / flux-react-example / tests / unit / actions / routes.js View on Github external
beforeEach(function () {
    context = createMockActionContext({
      stores: [RouteStore]
    });
  });
github quran / quran.com-frontend / tests / unit / actions / AudioplayerActions.spec.js View on Github external
beforeEach(function() {
    currentRoute = Immutable.Map({
      path: 'http:localhost:8000',
      params: Immutable.Map({
        range: '1-10',
        surahId: 2
      })
    });

    actionContext = createMockActionContext({
      stores: [AyahsStore, RouteStore]
    });

    actionContext.getStore('AyahsStore').ayahs = getAyahs.slice(0, 10);

    actionContext.getStore('RouteStore').getCurrentRoute = function() {
      return currentRoute;
    }

    sinon.stub(actionContext, 'executeAction');

  });
github localnerve / flux-react-example / tests / unit / utils / fluxibleRouteTransformer.js View on Github external
function createMockContext () {
    context = createMockActionContext({
      stores: [ApplicationStore, ContentStore]
    });
    context.service = new MockService();
    context.service.setService('routes', function (method, params, config, callback) {
      if (params.emulateError) {
        return callback(mockError);
      }
      callback(null, fluxibleRoutes);
    });
    context.service.setService('page', function (method, params, config, callback) {
      if (params.emulateError) {
        return callback(mockError);
      }
      callback(null, '<h1>Hello World</h1>');
    });
  }
github localnerve / flux-react-example / tests / unit / actions / contact.js View on Github external
beforeEach(function () {
    context = createMockActionContext({
      stores: [ ContactStore ]
    });
    context.service = new MockService();
    context.service.setService('contact', function (method, params, body, config, callback) {
      serviceMail.send(params, callback);
    });
  });
github localnerve / flux-react-example / tests / unit / actions / init.js View on Github external
beforeEach(function () {
    context = createMockActionContext({
      stores: [ BackgroundStore ]
    });
  });