mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-22 16:09:14 +08:00
fix(specs): fix more broken specs
This commit is contained in:
parent
ccaf78ce99
commit
7ae89927e1
7 changed files with 14 additions and 15 deletions
|
@ -31,7 +31,7 @@ describe("DefaultClientNotif", function DefaultClientNotifTests() {
|
|||
expect(NylasEnv.config.get).toHaveBeenCalledWith(SETTINGS_KEY);
|
||||
});
|
||||
it("renders nothing", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -42,7 +42,7 @@ describe("DefaultClientNotif", function DefaultClientNotifTests() {
|
|||
expect(NylasEnv.config.get).toHaveBeenCalledWith(SETTINGS_KEY);
|
||||
});
|
||||
it("renders a notification", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
});
|
||||
|
||||
it("allows the user to set N1 as the default client", () => {
|
||||
|
@ -66,7 +66,7 @@ describe("DefaultClientNotif", function DefaultClientNotifTests() {
|
|||
this.notif = mount(<DefaultClientNotification />)
|
||||
})
|
||||
it("renders nothing", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
});
|
||||
})
|
||||
});
|
||||
|
|
|
@ -9,7 +9,7 @@ describe("DevModeNotif", function DevModeNotifTests() {
|
|||
this.notif = mount(<DevModeNotification />);
|
||||
})
|
||||
it("displays a notification", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -19,7 +19,7 @@ describe("DevModeNotif", function DevModeNotifTests() {
|
|||
this.notif = mount(<DevModeNotification />);
|
||||
})
|
||||
it("doesn't display a notification", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
})
|
||||
})
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ describe("DisabledMailRulesNotification", function DisabledMailRulesNotifTests()
|
|||
this.notif = mount(<DisabledMailRulesNotification />)
|
||||
})
|
||||
it("displays a notification", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
})
|
||||
|
||||
it("allows users to open the preferences", () => {
|
||||
|
@ -33,7 +33,7 @@ describe("DisabledMailRulesNotification", function DisabledMailRulesNotifTests()
|
|||
this.notif = mount(<DisabledMailRulesNotification />)
|
||||
})
|
||||
it("displays a notification", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
})
|
||||
|
||||
it("allows users to open the preferences", () => {
|
||||
|
@ -51,7 +51,7 @@ describe("DisabledMailRulesNotification", function DisabledMailRulesNotifTests()
|
|||
this.notif = mount(<DisabledMailRulesNotification />)
|
||||
})
|
||||
it("does not display a notification", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -10,7 +10,7 @@ describe("OfflineNotif", function offlineNotifTests() {
|
|||
this.notif = mount(<OfflineNotification />);
|
||||
})
|
||||
it("displays a notification", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
})
|
||||
|
||||
it("allows the user to try connecting now", () => {
|
||||
|
@ -24,7 +24,7 @@ describe("OfflineNotif", function offlineNotifTests() {
|
|||
this.notif = mount(<OfflineNotification />);
|
||||
})
|
||||
it("doesn't display a notification", () => {
|
||||
expect(this.notif.find('.notification').exists()).toEqual(true);
|
||||
expect(this.notif.find('.notification').exists()).toEqual(false);
|
||||
})
|
||||
})
|
||||
});
|
||||
|
|
|
@ -14,9 +14,9 @@ const stubNotif = (priority) => {
|
|||
|
||||
const checkHighestPriority = (expectedPriority, wrapper) => {
|
||||
const visibleElems = wrapper.find(".highest-priority")
|
||||
expect(visibleElems.exists()).toEqual(false);
|
||||
expect(visibleElems.exists()).toEqual(true);
|
||||
const titleElem = visibleElems.first().find('.title');
|
||||
expect(titleElem.exists()).toEqual(false);
|
||||
expect(titleElem.exists()).toEqual(true);
|
||||
expect(titleElem.text().trim()).toEqual(`Priority ${expectedPriority}`);
|
||||
// Make sure there's only one highest-priority elem
|
||||
expect(visibleElems.get(1)).toEqual(undefined);
|
||||
|
|
|
@ -40,8 +40,7 @@ export default class NewsletterSignup extends React.Component {
|
|||
LegacyEdgehillAPI.makeRequest({
|
||||
method: 'GET',
|
||||
path: this._path(props),
|
||||
}).run()
|
||||
.then((status) => {
|
||||
}).run().then((status) => {
|
||||
if (status === 'Never Subscribed') {
|
||||
this._onSubscribe();
|
||||
} else {
|
||||
|
|
|
@ -30,7 +30,7 @@ class _EdgehillAPI {
|
|||
|
||||
makeRequest(options = {}) {
|
||||
if (NylasEnv.getLoadSettings().isSpec) {
|
||||
return Promise.resolve();
|
||||
return {run: () => Promise.resolve()}
|
||||
}
|
||||
|
||||
if (options.authWithNylasAPI) {
|
||||
|
|
Loading…
Reference in a new issue