Skip to content

Commit

Permalink
Remove upcoming events (#23080)
Browse files Browse the repository at this point in the history
* Remove upcoming events

* skip test

* between the two of us we'll get this right, skip another test

Co-authored-by: Laurie Barth <[email protected]>
  • Loading branch information
LB and Laurie Barth authored Apr 14, 2020
1 parent 85e3580 commit 900f31c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions www/src/components/events/__tests__/event-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ describe(`<Events />`, () => {
expect(getByText(`No events are scheduled right now.`)).toBeVisible()
})

it(`splits upcoming and past events`, () => {

it.skip(`splits upcoming and past events`, () => {
const { getByText } = render(
<Events
events={mockEvents(
Expand Down Expand Up @@ -57,7 +58,7 @@ describe(`<Events />`, () => {
dateNowSpy.mockRestore()
})

it(`display's today's events as upcoming`, () => {
it.skip(`display's today's events as upcoming`, () => {
const { getByText } = render(
<Events events={mockEvents([`2100-10-08`].map(toEvent))} />
)
Expand Down
11 changes: 6 additions & 5 deletions www/src/components/events/event-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ import Event from "./event"
export default function EventList({ events }) {
const endOfDay = date => new Date(date).setHours(23, 59, 59, 999)

const upcoming = events.nodes.filter(
event => endOfDay(event.data.date) >= Date.now()
)
// const upcoming = events.nodes.filter(
// event => endOfDay(event.data.date) >= Date.now()
// )

const past = events.nodes
.filter(event => endOfDay(event.data.date) < Date.now())
.reverse()

return events.nodes.length > 0 ? (
<>
<h2>Upcoming Events</h2>
// Temporarily removing during COVID
{/* <h2>Upcoming Events</h2>
<ul>
{upcoming.map(event => (
<li key={event.id}>
<Event event={event.data} />
</li>
))}
</ul>
</ul> */}
<h2>Past Events</h2>
<ul>
{past.map(event => (
Expand Down

0 comments on commit 900f31c

Please sign in to comment.