Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
});
beforeEach(function() {
context = createMockComponentContext({});
sinon.stub(context, 'executeAction');
var SearchInputClass = provideContext(SearchInput);
component = ReactTestUtils.renderIntoDocument(
);
node = ReactDOM.findDOMNode(component);
});
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);
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);
}
});