This file contains hidden or 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 React, { Component } from 'react'; | |
| import { | |
| Button, | |
| StyleSheet, | |
| Text, | |
| View, | |
| } from 'react-native'; | |
| export default class Counter extends Component { | |
| render() { |
This file contains hidden or 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 React, { Component } from 'react'; | |
| import { bindActionCreators } from 'redux' | |
| import { connect } from 'react-redux'; | |
| import Counter from '../components/Counter.js'; | |
| const mapStateToProps = state => ({ | |
| count: state | |
| }) | |
| const mapDispatchToProps = (dispatch) => ({ |
This file contains hidden or 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 { counter } from './store.js' | |
| describe('reducers', () => { | |
| describe('counter', () => { | |
| it('should provide the initial state', () => { | |
| expect(counter(undefined, {})).toBe(0) | |
| }) | |
| it('should handle INCREMENT action', () => { | |
| expect(counter(1, { type: 'INCREMENT' })).toBe(2) |
This file contains hidden or 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 } from 'redux' | |
| export const counter = (state = 0, action) => { | |
| switch (action.type) { | |
| case 'INCREMENT': | |
| return state + 1; | |
| case 'DECREMENT': | |
| return state - 1; | |
| case 'RESET': | |
| return 0; |
This file contains hidden or 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 React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import ListingItem from './ListingItem.js'; | |
| import { MemoryRouter } from 'react-router'; | |
| it('renders without crashing', () => { | |
| const div = document.createElement('div'); | |
| ReactDOM.render(<MemoryRouter> | |
| <ListingItem index={0} item={{ | |
| thumbnail: '', |
This file contains hidden or 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 React from 'react'; | |
| import { Link } from 'react-router' | |
| import logo from './logo.svg'; | |
| import './App.css'; | |
| import { BrowserRouter, Match } from 'react-router'; | |
| import FrontPageContainer from './containers/FrontPageContainer.js'; | |
| import SubredditPageContainer from './containers/SubredditPageContainer.js'; | |
| import DefaultRedditsContainer from './containers/DefaultRedditsContainer.js' |
This file contains hidden or 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 React from 'react'; | |
| import { Link } from 'react-router' | |
| import logo from './logo.svg'; | |
| import './App.css'; | |
| import DefaultRedditsContainer from './containers/DefaultRedditsContainer.js' | |
| const App = (props) => ( | |
| <div className="App container-fluid"> | |
| <div className="App-reddit-selector"> |
This file contains hidden or 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 React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import { Provider } from 'react-redux'; | |
| import App from './App'; | |
| import './index.css'; | |
| import { createStore, applyMiddleware } from 'redux'; | |
| import thunk from 'redux-thunk'; |
This file contains hidden or 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 React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import { Provider } from 'react-redux' | |
| import { Router, Route, browserHistory } from 'react-router' | |
| import App from './App'; | |
| import './index.css'; | |
| import FrontPageContainer from './containers/FrontPageContainer.js'; | |
| import SubredditPageContainer from './containers/SubredditPageContainer.js'; |
This file contains hidden or 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
| public class ApplicationTest { | |
| private static FirefoxDriver driver; | |
| @BeforeClass | |
| public static void setUp() throws IOException { | |
| driver = new FirefoxDriver(); | |
| } | |
| @Test |