Skip to content

Commit

Permalink
automatic lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw authored and njpearman committed Nov 13, 2020
1 parent c0d6d95 commit 7273e38
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 34 deletions.
27 changes: 13 additions & 14 deletions packages/__tests__/src/icalendar/day-view.ts
@@ -1,30 +1,29 @@
import XHRMock from 'xhr-mock'
import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper'
import timeGridPlugin from '@fullcalendar/timegrid'
import { EventSourceInput } from '@fullcalendar/core'
import iCalendarPlugin from '@fullcalendar/icalendar'

import oneHourMeeting from './data/oneHourMeeting'
import recurringWeeklyMeeting from './data/recurringWeeklyMeeting'
import mungedOneHourMeeting from './data/mungedOneHourMeeting'
import meetingWithMungedStart from './data/meetingWithMungedStart'
import alldayEvent from './data/alldayEvent'
import timedMeetingWithoutEnd from './data/timedMeetingWithoutEnd'
import timedMeetingWithDuration from './data/timedMeetingWithDuration'
import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper'

describe('addICalEventSource with week view', function() {
describe('addICalEventSource with week view', () => {
const ICAL_MIME_TYPE = 'text/calendar'

pushOptions({
plugins: [ iCalendarPlugin, timeGridPlugin ],
plugins: [iCalendarPlugin, timeGridPlugin],
initialDate: '2019-04-15', // The start of the week for oneHourMeeting
initialView: 'timeGridDay',
timeZone: 'Europe/Paris',
})

beforeEach(function() { XHRMock.setup() })
beforeEach(() => { XHRMock.setup() })

afterEach(function() { XHRMock.teardown() })
afterEach(() => { XHRMock.teardown() })

it('correctly adds a one-hour long meeting', (done) => {
loadICalendarWith(oneHourMeeting, () => {
Expand All @@ -33,7 +32,7 @@ describe('addICalEventSource with week view', function() {
done()
}, 100)
})
})
})

xit('correctly adds a repeating weekly meeting', (done) => {
// I want to test that the event for the current week is visible but
Expand All @@ -44,13 +43,13 @@ describe('addICalEventSource with week view', function() {
done()
}, 100)
})
})
})

it('adds an all day event', (done) => {
loadICalendarWith(alldayEvent, () => {
setTimeout(() => {
assertEventCount(1)
currentCalendar.getEvents().forEach(event => expect(event.allDay).toBeTruthy())
currentCalendar.getEvents().forEach((event) => expect(event.allDay).toBeTruthy())
done()
})
})
Expand All @@ -62,17 +61,17 @@ describe('addICalEventSource with week view', function() {
assertEventCount(0)
done()
}, 100)
})
})
})
})

it('ignores a meeting with a munged start', (done) => {
loadICalendarWith(meetingWithMungedStart, () => {
setTimeout(() => {
assertEventCount(0)
done()
}, 100)
})
})
})
})

it('sets default duration when forceEventDuration is enabled and no end or duration included in the VEVENT', (done) => {
loadICalendarWith(timedMeetingWithoutEnd,
Expand Down Expand Up @@ -132,7 +131,7 @@ describe('addICalEventSource with week view', function() {
function loadICalendarWith(rawICal: string, assertions: () => void, calendarSetup?: (source: EventSourceInput) => void) {
const feedUrl = '/mock.ics'

XHRMock.get(feedUrl, function(req, res) {
XHRMock.get(feedUrl, (req, res) => {
expect(req.url().query).toEqual({})

return res.status(200)
Expand Down
40 changes: 20 additions & 20 deletions packages/__tests__/src/icalendar/month-view.ts
@@ -1,8 +1,8 @@
import XHRMock from 'xhr-mock'
import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper'
import dayGridMonth from '@fullcalendar/daygrid'
import { EventSourceInput } from '@fullcalendar/core'
import iCalendarPlugin from '@fullcalendar/icalendar'
import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper'

import alldayEvent from './data/alldayEvent'
import multidayEvent from './data/multidayEvent'
Expand All @@ -12,24 +12,24 @@ import oneHourMeeting from './data/oneHourMeeting'
import recurringWeeklyMeeting from './data/recurringWeeklyMeeting'
import mungedOneHourMeeting from './data/mungedOneHourMeeting'

describe('addICalEventSource with month view', function() {
describe('addICalEventSource with month view', () => {
const ICAL_MIME_TYPE = 'text/calendar'

pushOptions({
plugins: [ iCalendarPlugin, dayGridMonth ],
plugins: [iCalendarPlugin, dayGridMonth],
initialDate: '2019-04-10', // the start of the three-day event in the feed
initialView: 'dayGridMonth',
})

beforeEach(function() { XHRMock.setup() })
beforeEach(() => { XHRMock.setup() })

afterEach(function() { XHRMock.teardown() })
afterEach(() => { XHRMock.teardown() })

it('correctly adds an all day event', (done) => {
loadICalendarWith(alldayEvent, () => {
setTimeout(() => {
assertEventCount(1)
currentCalendar.getEvents().forEach(event => expect(event.allDay).toBeTruthy())
currentCalendar.getEvents().forEach((event) => expect(event.allDay).toBeTruthy())
done()
}, 100)
})
Expand All @@ -39,7 +39,7 @@ describe('addICalEventSource with month view', function() {
loadICalendarWith(multidayEvent, () => {
setTimeout(() => {
assertEventCount(1)
currentCalendar.getEvents().forEach(event => expect(event.allDay).toBeTruthy())
currentCalendar.getEvents().forEach((event) => expect(event.allDay).toBeTruthy())
done()
}, 100)
})
Expand All @@ -49,7 +49,7 @@ describe('addICalEventSource with month view', function() {
loadICalendarWith(multipleMultidayEvents, () => {
setTimeout(() => {
assertEventCount(2)
currentCalendar.getEvents().forEach(event => expect(event.allDay).toBeTruthy())
currentCalendar.getEvents().forEach((event) => expect(event.allDay).toBeTruthy())
done()
}, 100)
})
Expand All @@ -59,11 +59,11 @@ describe('addICalEventSource with month view', function() {
loadICalendarWith(oneHourMeeting, () => {
setTimeout(() => {
assertEventCount(1)
currentCalendar.getEvents().forEach(event => expect(event.allDay).not.toBeTruthy())
currentCalendar.getEvents().forEach((event) => expect(event.allDay).not.toBeTruthy())
done()
}, 100)
})
})
})

it('correctly adds a repeating weekly meeting', (done) => {
loadICalendarWith(recurringWeeklyMeeting, () => {
Expand All @@ -72,25 +72,25 @@ describe('addICalEventSource with month view', function() {
done()
}, 100)
})
})
})

it('ignores a munged event', (done) => {
loadICalendarWith(mungedOneHourMeeting, () => {
setTimeout(() => {
assertEventCount(0)
done()
}, 100)
})
})
done()
}, 100)
})
})

it('adds a valid event and ignores a munged event', (done) => {
loadICalendarWith(multipleEventsOneMunged, () => {
setTimeout(() => {
assertEventCount(1)
done()
}, 100)
})
})
done()
}, 100)
})
})

it('defaultAllDayEventDuration does not override ical default all day length of one day', (done) => {
loadICalendarWith(alldayEvent,
Expand All @@ -114,7 +114,7 @@ describe('addICalEventSource with month view', function() {
function loadICalendarWith(rawICal: string, assertions: () => void, calendarSetup?: (source: EventSourceInput) => void) {
const feedUrl = '/mock.ics'

XHRMock.get(feedUrl, function(req, res) {
XHRMock.get(feedUrl, (req, res) => {
expect(req.url().query).toEqual({})

return res.status(200)
Expand Down

0 comments on commit 7273e38

Please sign in to comment.