From 85fdf4399504d58ed6802ddd2eec0cb1ddab50de Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Thu, 6 Aug 2015 12:22:06 -0700 Subject: [PATCH] fix(specs/keys): Fix broken specs, clean up CJSX --- .../attachments/lib/attachment-component.cjsx | 5 +++-- .../lib/developer-bar-store.coffee | 2 +- .../message-list/spec/message-list-spec.cjsx | 13 ++--------- .../notifications/lib/activity-sidebar.cjsx | 4 ++-- .../lib/sidebar-internal.cjsx | 2 +- .../thread-list/stylesheets/thread-list.less | 8 ++++--- spec-nylas/stores/draft-store-spec.coffee | 22 +++++++++---------- 7 files changed, 25 insertions(+), 31 deletions(-) diff --git a/internal_packages/attachments/lib/attachment-component.cjsx b/internal_packages/attachments/lib/attachment-component.cjsx index 5fa8ad35c..7417180dc 100644 --- a/internal_packages/attachments/lib/attachment-component.cjsx +++ b/internal_packages/attachments/lib/attachment-component.cjsx @@ -28,6 +28,7 @@ class AttachmentComponent extends React.Component {@props.file.displayName()} {@_renderFileActions()} @@ -58,10 +59,10 @@ class AttachmentComponent extends React.Component _isDownloading: => @props.download?.state is "downloading" _renderRemoveIcon: -> - + _renderDownloadButton: -> - + _onDragStart: (event) => path = FileDownloadStore.pathForFile(@props.file) diff --git a/internal_packages/developer-bar/lib/developer-bar-store.coffee b/internal_packages/developer-bar/lib/developer-bar-store.coffee index 95e2a238b..59c904171 100644 --- a/internal_packages/developer-bar/lib/developer-bar-store.coffee +++ b/internal_packages/developer-bar/lib/developer-bar-store.coffee @@ -84,7 +84,7 @@ DeveloperBarStore = Reflux.createStore data = "-d '#{postBody}'" unless request.method == 'GET' item = - id: curlItemId + id: "curlitemId:#{curlItemId}" command: "curl -X #{request.method} #{data} #{url}" statusCode: response?.statusCode || 0 diff --git a/internal_packages/message-list/spec/message-list-spec.cjsx b/internal_packages/message-list/spec/message-list-spec.cjsx index 86e02d031..d9b5152fc 100644 --- a/internal_packages/message-list/spec/message-list-spec.cjsx +++ b/internal_packages/message-list/spec/message-list-spec.cjsx @@ -270,17 +270,8 @@ describe "MessageList", -> MessageStore._items = [m5, m3, draftMessages[0]] MessageStore._thread = test_thread MessageStore.trigger() - cs = TestUtils.scryRenderedDOMComponentsWithClass(@messageList, "footer-reply-area-wrap") - expect(cs.length).toBe 1 - expect(React.findDOMNode(cs[0]).style.height).toBe "0px" - - it "shows the reply type if the last message isnt a draft", -> - MessageStore._items = [m5, m3] - MessageStore._thread = test_thread - MessageStore.trigger() - cs = TestUtils.scryRenderedDOMComponentsWithClass(@messageList, "footer-reply-area-wrap") - expect(cs.length).toBe 1 - expect(parseInt(React.findDOMNode(cs[0]).style.height)).toBeGreaterThan 0 + cs = TestUtils.scryRenderedDOMComponentsWithClass(@messageList, "footer-reply-area") + expect(cs.length).toBe 0 describe "reply behavior (_createReplyOrUpdateExistingDraft)", -> beforeEach -> diff --git a/internal_packages/notifications/lib/activity-sidebar.cjsx b/internal_packages/notifications/lib/activity-sidebar.cjsx index 1af3749aa..2d1d42ebe 100644 --- a/internal_packages/notifications/lib/activity-sidebar.cjsx +++ b/internal_packages/notifications/lib/activity-sidebar.cjsx @@ -65,13 +65,13 @@ class ActivitySidebar extends React.Component if incomplete is 0 return [] else if error -
+
Initial sync encountered an error. Waiting to retry...
Try Again
else -
+
diff --git a/internal_packages/sidebar-inbox-internal/lib/sidebar-internal.cjsx b/internal_packages/sidebar-inbox-internal/lib/sidebar-internal.cjsx index 70a593eb3..456699de4 100644 --- a/internal_packages/sidebar-inbox-internal/lib/sidebar-internal.cjsx +++ b/internal_packages/sidebar-inbox-internal/lib/sidebar-internal.cjsx @@ -108,7 +108,7 @@ class SidebarInternal extends React.Component value = "True" if value is true value = "False" if value is false value = moment.unix(value).format("DD / MM / YYYY h:mm a z") if key.indexOf("_time") > 0 - cjsx.push
{displayName}:{value}
+ cjsx.push
{displayName}:{value}
cjsx _appUrl: (app) => diff --git a/internal_packages/thread-list/stylesheets/thread-list.less b/internal_packages/thread-list/stylesheets/thread-list.less index 7728ce7e2..9a02c89b3 100644 --- a/internal_packages/thread-list/stylesheets/thread-list.less +++ b/internal_packages/thread-list/stylesheets/thread-list.less @@ -76,9 +76,6 @@ font-size: @font-size-small; text-overflow: ellipsis; overflow: hidden; - .unread-true { - font-weight: @font-weight-semi-bold; - } position: relative; top:2px; } @@ -133,6 +130,11 @@ .list-column { border-bottom: 1px solid @list-border; } + .participants { + .unread-true { + font-weight: @font-weight-semi-bold; + } + } } .unread:not(.focused) { diff --git a/spec-nylas/stores/draft-store-spec.coffee b/spec-nylas/stores/draft-store-spec.coffee index eb34a42dc..137cf8edf 100644 --- a/spec-nylas/stores/draft-store-spec.coffee +++ b/spec-nylas/stores/draft-store-spec.coffee @@ -463,20 +463,20 @@ describe "DraftStore", -> describe "onDestroyDraft", -> beforeEach -> - @draftReset = jasmine.createSpy('draft reset') + @draftSessionTeardown = jasmine.createSpy('draft teardown') @session = draft: -> pristine: false changes: commit: -> Promise.resolve() - reset: @draftReset - cleanup: -> + teardown: -> + teardown: @draftSessionTeardown DraftStore._draftSessions = {"abc": @session} spyOn(Actions, 'queueTask') - it "should reset the draft session, ensuring no more saves are made", -> + it "should teardown the draft session, ensuring no more saves are made", -> DraftStore._onDestroyDraft('abc') - expect(@draftReset).toHaveBeenCalled() + expect(@draftSessionTeardown).toHaveBeenCalled() it "should not throw if the draft session is not in the window", -> expect -> @@ -565,7 +565,7 @@ describe "DraftStore", -> DraftStore._draftSessions = {} proxy = prepare: -> Promise.resolve(proxy) - cleanup: -> + teardown: -> draft: -> {} changes: commit: -> Promise.resolve() @@ -638,9 +638,9 @@ describe "DraftStore", -> task = Actions.queueTask.calls[0].args[0] expect(task.fromPopout).toBe true - describe "session cleanup", -> + describe "session teardown", -> beforeEach -> - @draftCleanup = jasmine.createSpy('draft cleanup') + @draftTeardown = jasmine.createSpy('draft teardown') @session = draftLocalId: "abc" draft: -> @@ -648,15 +648,15 @@ describe "DraftStore", -> changes: commit: -> Promise.resolve() reset: -> - cleanup: @draftCleanup + teardown: @draftTeardown DraftStore._draftSessions = {"abc": @session} DraftStore._doneWithSession(@session) it "removes from the list of draftSessions", -> expect(DraftStore._draftSessions["abc"]).toBeUndefined() - it "Calls cleanup on the session", -> - expect(@draftCleanup).toHaveBeenCalled + it "Calls teardown on the session", -> + expect(@draftTeardown).toHaveBeenCalled describe "mailto handling", -> describe "extensions", ->