Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove events list beneath calendar #45

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
500b3ec
Add events route, functionality to communicate with api
Kachulio1 Oct 12, 2018
3bfe30a
Rename Events to EventList
Kachulio1 Oct 19, 2018
32941d0
Added semantic ui
Kachulio1 Oct 19, 2018
db62e9b
style event list using cards
Kachulio1 Oct 19, 2018
86d5b48
convert navbar to semantic ui
Kachulio1 Oct 26, 2018
cc02845
add logic to check if the component is mounted
Kachulio1 Nov 2, 2018
5b1f9ac
add av-navbar to fix border-radius and margin
Kachulio1 Nov 2, 2018
c556323
Extracted DropdownMenu
FedericoEsparza Nov 9, 2018
126e7cd
React Mob 65. Substring date. Troubleshoot yarn test
FedericoEsparza Nov 16, 2018
73a1641
13 events calendar (#14)
dkuku Nov 26, 2018
be6c680
add redux
Kachulio1 Nov 26, 2018
b53e569
Add styling, localstorage caching
mattwr18 Nov 26, 2018
56a5209
Start add redux testing
mattwr18 Nov 28, 2018
2127a6d
add store test
Kachulio1 Nov 28, 2018
cec5372
Remove unused logo from App
mattwr18 Nov 29, 2018
0d932c6
Remove proxy
mattwr18 Nov 29, 2018
0a94e1e
Change api endpoint
mattwr18 Nov 29, 2018
3c2a64d
add test for Navbar
Kachulio1 Nov 30, 2018
5207a59
Merge branch '13-events-calendar' of github.com:AgileVentures/agile-v…
mattwr18 Dec 1, 2018
4a514a6
Add some styling and navbar links
mattwr18 Dec 3, 2018
3b5ef7b
Change endpoint to heroku one
mattwr18 Dec 3, 2018
bfe6cc3
Update endpoint to production, fix js warnings
mattwr18 Dec 3, 2018
bb342d3
Staging endpoint
mattwr18 Dec 3, 2018
d2cbe6d
Production endpoint
mattwr18 Dec 3, 2018
182480a
Add www to endpoint
mattwr18 Dec 3, 2018
e381c09
Remove list of Events, leave just calendar
mattwr18 Dec 7, 2018
309f152
Improve test coverage
mattwr18 Dec 18, 2018
b2d9cf8
Merge branch 'develop' of github.com:AgileVentures/agile-ventures-web…
mattwr18 Dec 18, 2018
8fd7b23
Fix build failures
mattwr18 Dec 18, 2018
0691e40
Refactor tests, ignore index.js App.js from coverage
mattwr18 Dec 18, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Refactor tests, ignore index.js App.js from coverage
mattwr18 committed Dec 18, 2018
commit 0691e40a66590561666cd347e70ae6fa93e0ba2f
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom --coverage --collectCoverageFrom=src/**/*js --collectCoverageFrom=!src/registerServiceWorker.js",
"test": "react-scripts test --env=jsdom --coverage --collectCoverageFrom=src/**/*js --collectCoverageFrom=!src/registerServiceWorker.js --collectCoverageFrom=!src/index.js --collectCoverageFrom=!src/App.js",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"eject": "react-scripts eject"
},
2 changes: 1 addition & 1 deletion src/components/EventsList.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import BigCalendar from "react-big-calendar";
import moment from "moment";
import "react-big-calendar/lib/css/react-big-calendar.css";
import "../assets/eventsList.css";
class EventsList extends Component {
export class EventsList extends Component {
constructor(props) {
super(props);
this.state = {
21 changes: 8 additions & 13 deletions src/tests/EventsList.test.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
import React from "react";
import { shallow, mount } from "enzyme";
import EventsList from "../components/EventsList";
import configureStore from "redux-mock-store";
import thunk from "redux-thunk";
import { EventsList } from "../components/EventsList";
import eventsFixture from "../fixtures/events.js";

describe("EventsList", () => {
const middlewares = [thunk];
const mockStore = configureStore(middlewares);
const initialState = {
events: eventsFixture
};
const store = mockStore(initialState);

let wrapper;
let spy = jest.fn();
beforeEach(() => {
wrapper = shallow(<EventsList store={store} />).dive();
wrapper = shallow(<EventsList events={[]} fetchEvents={spy} />);
});

it("should fetch events if none are in the store", () => {
expect(spy).toHaveBeenCalledTimes(1);
});

it("should render one BigCalendar component", () => {
expect(wrapper.find(".big-calendar")).toHaveLength(1);
});

it("should save to localStorage", () => {
wrapper = mount(<EventsList store={store} />);
wrapper = mount(<EventsList events={eventsFixture} />);
const KEY = "events",
VALUE = JSON.stringify(eventsFixture);
wrapper.instance().forceUpdate();
wrapper.update();
expect(localStorage.setItem).toHaveBeenLastCalledWith(KEY, VALUE);
expect(localStorage.__STORE__[KEY]).toBe(VALUE);
expect(Object.keys(localStorage.__STORE__).length).toBe(1);