From e674e7519bed174f4e01314eee71d08375992307 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Wed, 24 May 2017 15:57:09 -0400 Subject: [PATCH 1/2] Restore assertion verifying issue title truncation Prior to #114, this test asserted that the issue title gets truncation, but that assertion was removed in #114. Since the essence of this test involves the truncation of the issue title, it seems appropriate to assert that the issue title gets correctly truncation. --- spec/notifications-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/notifications-spec.coffee b/spec/notifications-spec.coffee index a0060c2a..a1ddf168 100644 --- a/spec/notifications-spec.coffee +++ b/spec/notifications-spec.coffee @@ -699,8 +699,8 @@ describe "Notifications", -> runs -> button = fatalError.querySelector('.btn') - encodedMessage = encodeURIComponent(truncatedMessage) expect(button.textContent).toContain 'Create issue' + expect(fatalError.issue.getIssueTitle()).toBe(truncatedMessage) describe "when the package is out of date", -> beforeEach -> From 84f960142729a76d6715adabe7969681989e5fad Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Wed, 24 May 2017 15:58:29 -0400 Subject: [PATCH 2/2] :art: Rename variable to increase clarity --- spec/notifications-spec.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/notifications-spec.coffee b/spec/notifications-spec.coffee index a1ddf168..6a9c452a 100644 --- a/spec/notifications-spec.coffee +++ b/spec/notifications-spec.coffee @@ -680,7 +680,7 @@ describe "Notifications", -> describe "when the message is longer than 100 characters", -> message = "Uncaught Error: Cannot find module 'dialog'Error: Cannot find module 'dialog' at Function.Module._resolveFilename (module.js:351:15) at Function.Module._load (module.js:293:25) at Module.require (module.js:380:17) at EventEmitter. (/Applications/Atom.app/Contents/Resources/atom/browser/lib/rpc-server.js:128:79) at EventEmitter.emit (events.js:119:17) at EventEmitter. (/Applications/Atom.app/Contents/Resources/atom/browser/api/lib/web-contents.js:99:23) at EventEmitter.emit (events.js:119:17)" - truncatedMessage = "Uncaught Error: Cannot find module 'dialog'Error: Cannot find module 'dialog' at Function.Module...." + expectedIssueTitle = "Uncaught Error: Cannot find module 'dialog'Error: Cannot find module 'dialog' at Function.Module...." beforeEach -> generateFakeFetchResponses() @@ -700,7 +700,7 @@ describe "Notifications", -> runs -> button = fatalError.querySelector('.btn') expect(button.textContent).toContain 'Create issue' - expect(fatalError.issue.getIssueTitle()).toBe(truncatedMessage) + expect(fatalError.issue.getIssueTitle()).toBe(expectedIssueTitle) describe "when the package is out of date", -> beforeEach ->