mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 13:44:41 +08:00
9e3c3c14cd
Summary: Move the old bar notifications to the sidebar, and only display one notification at a time using a priority-rating system. Remove all of the old notification infrastructure. Test Plan: Added specs, also reproduced notifications locally Reviewers: bengotow Reviewed By: bengotow Subscribers: juan Differential Revision: https://phab.nylas.com/D3310
30 lines
987 B
JavaScript
30 lines
987 B
JavaScript
import {mount} from 'enzyme';
|
|
import {React, NylasSyncStatusStore} from 'nylas-exports';
|
|
import OfflineNotification from '../lib/items/offline-notification';
|
|
|
|
describe("OfflineNotif", function offlineNotifTests() {
|
|
describe("When N1 is offline", () => {
|
|
beforeEach(() => {
|
|
spyOn(NylasSyncStatusStore, "connected").andReturn(false);
|
|
spyOn(NylasSyncStatusStore, "nextRetryDelay").andReturn(10000);
|
|
this.notif = mount(<OfflineNotification />);
|
|
})
|
|
it("displays a notification", () => {
|
|
expect(this.notif.find('.notification').isEmpty()).toEqual(false);
|
|
})
|
|
|
|
it("allows the user to try connecting now", () => {
|
|
|
|
})
|
|
})
|
|
|
|
describe("When N1 is online", () => {
|
|
beforeEach(() => {
|
|
spyOn(NylasSyncStatusStore, "connected").andReturn(true);
|
|
this.notif = mount(<OfflineNotification />);
|
|
})
|
|
it("doesn't display a notification", () => {
|
|
expect(this.notif.find('.notification').isEmpty()).toEqual(true);
|
|
})
|
|
})
|
|
});
|