Mailspring/spec/components/nylas-calendar/calendar-toggles-spec.jsx
Evan Morikawa de0f2374fe feat(calendar): can pick which calendars you want displayed
Summary:
Adds a resizable column next to the calendar that lets you pick which
calendars you want to turn on and off.

The picker sidebar styling mimics that of the main account sidebar.

Calendars are grouped by account.

We store the disabled calendars in in your config.

I added a `notIn` SQL method so it'll perform `WHERE calendarId NOT IN
['a', 'b', ...]` instead of `NOT (WHERE calendarId IN ['a', 'b', 'c'])`

I wanted it to be an exclusion (instead of inclusion) list so the default
was "all on" and we didn't need to always fetch the full list of
calendarIds from the database to compare against.

This also fixed a test that was failing constantly: The Query Subscription
Pool Spec was not being properly reset on each test. As a result, the test
would fail with an instance of a query subscription that Jasmine would
attempt to pretty print. Jasmine would fail to pretty print it because of
a jasmine bug that fails to properly display Objects with null prototypes.
The DatabaseStore's EventEmitter has a property with a null prototyp
causing the error

Test Plan: manual

Reviewers: bengotow, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3336
2016-10-13 11:37:19 -04:00

26 lines
801 B
JavaScript

import React from 'react'
import ReactTestUtils from 'react-addons-test-utils'
import { now } from './test-utils'
import TestDataSource from './test-data-source'
import {NylasCalendar} from 'nylas-component-kit'
import CalendarToggles from '../../../src/components/nylas-calendar/calendar-toggles'
describe("Nylas Calendar Toggles", function calendarPickerSpec() {
beforeEach(() => {
this.dataSource = new TestDataSource();
this.calendar = ReactTestUtils.renderIntoDocument(
<NylasCalendar
currentMoment={now()}
onCalendarMouseDown={this.onCalendarMouseDown}
dataSource={this.dataSource}
/>
);
this.toggles = ReactTestUtils.findRenderedComponentWithType(this.calendar, CalendarToggles);
});
it("renders the toggles", () => {
});
});