How to use the fluxible/utils.createMockComponentContext 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 / components / Html.js View on Github external
beforeEach(function () {
    testProps.context = createMockComponentContext({
      stores: [ApplicationStore, BackgroundStore]
    });
    var htmlElement = HtmlComponent(testProps);

    // This enables dom render after HtmlComponent factory call.
    // This mimics what really happens.
    testDom.start();

    // Go ahead and renderIntoDocument. Keep reference in htmlComponent.
    htmlComponent = renderHtmlIntoDocument(htmlElement);
  });
github quran / quran.com-frontend / tests / unit / components / header / SearchInput.spec.js View on Github external
beforeEach(function() {
    context = createMockComponentContext({});
    sinon.stub(context, 'executeAction');

    var SearchInputClass = provideContext(SearchInput);

    component = ReactTestUtils.renderIntoDocument(
      
    );

    node = ReactDOM.findDOMNode(component);
  });
github quran / quran.com-frontend / tests / unit / components / audioplayer / Audioplayer.spec.js View on Github external
beforeEach(function() {
    clock = sinon.useFakeTimers();

    context = createMockComponentContext({
      stores: [AudioplayerStore, SurahsStore, AyahsStore]
    });

    context.getStore('SurahsStore').surahs = getSurahs;
    context.getStore('AyahsStore').ayahs = getAyahs;
    context.getStore('AudioplayerStore').currentAyah = getAyahs[0];
    context.getStore('AudioplayerStore').currentAudio = new AudioStub(getAyahs[0].audio.mp3.url);

    var AudioplayerClass = provideContext(Audioplayer);

    component = ReactTestUtils.renderIntoDocument(
      
    );

    node = ReactDOM.findDOMNode(component);
github quran / quran.com-frontend / tests / unit / components / Pagination.spec.js View on Github external
makeComponent = function(page) {
      var currentRoute = Immutable.Map({
        path: 'http:localhost:8000',
        query: Immutable.Map({q: 'light', p: page || 1})
      });

      var context = createMockComponentContext({
        stores: [RouteStore]
      });

      context.dispatcherContext.dispatcher.stores.RouteStore.prototype.getCurrentRoute = function() {
        return currentRoute;
      }

      var PaginationClass = provideContext(Pagination);

      component = ReactTestUtils.renderIntoDocument(
        
      );

      node = ReactDOM.findDOMNode(component);
    }
  });