mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 00:06:06 +08:00
Fix specs
This commit is contained in:
parent
3343000f86
commit
f74ee7b6c2
|
@ -7,7 +7,6 @@
|
|||
DraftStore,
|
||||
AccountStore,
|
||||
DatabaseStore,
|
||||
FileUploadStore,
|
||||
SoundRegistry,
|
||||
SendDraftTask,
|
||||
ChangeMailTask,
|
||||
|
@ -671,7 +670,7 @@ describe "DraftStore", ->
|
|||
clientId: "local-123",
|
||||
threadId: "thread-123",
|
||||
replyToMessageId: "message-123"
|
||||
@uploads = ['stub']
|
||||
uploads: ['stub']
|
||||
DraftStore._draftSessions = {}
|
||||
DraftStore._draftsSending = {}
|
||||
@forceCommit = false
|
||||
|
@ -688,7 +687,6 @@ describe "DraftStore", ->
|
|||
spyOn(DraftStore, "_doneWithSession").andCallThrough()
|
||||
spyOn(DraftStore, "trigger")
|
||||
spyOn(SoundRegistry, "playSound")
|
||||
spyOn(FileUploadStore, "uploadsForMessage").andReturn(@uploads)
|
||||
spyOn(Actions, "queueTask")
|
||||
|
||||
it "plays a sound immediately when sending draft", ->
|
||||
|
@ -765,7 +763,6 @@ describe "DraftStore", ->
|
|||
task = Actions.queueTask.calls[0].args[0]
|
||||
expect(task instanceof SendDraftTask).toBe true
|
||||
expect(task.draft).toBe @draft
|
||||
expect(task.uploads).toBe @uploads
|
||||
|
||||
it "queues a SendDraftTask", ->
|
||||
runs ->
|
||||
|
|
|
@ -44,7 +44,9 @@ describe "SendDraftTask", ->
|
|||
expect(err.message).toBe "SendDraftTask - must be provided a draft."
|
||||
|
||||
it "throws an error if we we don't pass uploads", ->
|
||||
badTask = new SendDraftTask(new Message(), null)
|
||||
message = new Message()
|
||||
message.uploads = null
|
||||
badTask = new SendDraftTask(message)
|
||||
badTask.performLocal()
|
||||
.then ->
|
||||
throw new Error("Shouldn't succeed")
|
||||
|
@ -277,8 +279,8 @@ describe "SendDraftTask", ->
|
|||
subject: 'New Draft'
|
||||
draft: true
|
||||
body: 'hello world'
|
||||
@uploads = []
|
||||
@task = new SendDraftTask(@draft, @uploads)
|
||||
uploads: []
|
||||
@task = new SendDraftTask(@draft)
|
||||
@calledBody = "ERROR: The body wasn't included!"
|
||||
spyOn(DatabaseStore, "findBy").andCallFake =>
|
||||
include: (body) =>
|
||||
|
@ -317,8 +319,8 @@ describe "SendDraftTask", ->
|
|||
to:
|
||||
name: 'Dummy'
|
||||
email: 'dummy@nylas.com'
|
||||
@uploads = []
|
||||
@task = new SendDraftTask(@draft, @uploads)
|
||||
uploads: []
|
||||
@task = new SendDraftTask(@draft)
|
||||
@calledBody = "ERROR: The body wasn't included!"
|
||||
spyOn(DatabaseStore, "findBy").andCallFake =>
|
||||
then: -> throw new Error("You must include the body!")
|
||||
|
|
Loading…
Reference in a new issue