Last active
September 24, 2017 22:04
-
-
Save dschinkel/1ff5f62bce3557ad6c968cf3ab7f1504 to your computer and use it in GitHub Desktop.
Working Test I created for Armando
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, expect, mount, nock, Provider, React } from 'test/test.helpers'; | |
import axios from 'axios'; | |
import LiveScreen from 'app/screens/Live/index'; | |
import httpAdapter from 'axios/lib/adapters/http'; | |
axios.defaults.adapter = httpAdapter; | |
describe('Live Screen', () => { | |
it.only('renders a loader', () => { | |
const host = 'https://api-staging.ggg.com', | |
liveUri = '/fbc-content/_qa_v3/screens/live', | |
reducers = require('../../reducers').default, | |
store = createStore(reducers, {}) | |
mockGet(host, liveUri, 200, {}); | |
const app = mount( | |
<Provider store={store}> | |
<LiveScreen | |
breakpoint='' | |
fetchLiveVideo={() => {}} | |
clearLive={() => {}} | |
pageViewEvent={() => {}} | |
setIsAuthenticated={() => {}} | |
getUseUtagGlobal={() => {}} | |
saveLiveRestart={() => {}} | |
/> | |
</Provider> | |
).find('.ft-loader') | |
expect(app).to.have.length(1); | |
}); | |
const mockGet = (url, uri, responseCode, responseBody) => { | |
nock(url) | |
.get(uri) | |
.reply(responseCode, responseBody); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment