Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
test(update-panel-spec): restart notification detail
Browse files Browse the repository at this point in the history
  • Loading branch information
FalkF committed Apr 12, 2018
1 parent 24ea70c commit 8229639
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/updates-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default class UpdatesPanel {
detail += `${card.pack.name}@${oldVersion} -> ${newVersion}\n`
}
});
detail.trim()
detail = detail.trim()

const buttons = [{
text: 'Restart',
Expand Down
5 changes: 5 additions & 0 deletions spec/updates-panel-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ describe 'UpdatesPanel', ->

[cardA, cardB, cardC] = panel.packageCards

# fake a git url package
cardC.pack.apmInstallSource = { type: 'git', sha: 'cf23df2207d99a74fbe169e3eba035e633b65d94' }
cardC.pack.latestSha = 'a296114f3d0deec519a41f4c62e7fc56075b7f01'

spyOn(cardA, 'update').andReturn(new Promise((resolve, reject) -> [resolveA, rejectA] = [resolve, reject]))
spyOn(cardB, 'update').andReturn(new Promise((resolve, reject) -> [resolveB, rejectB] = [resolve, reject]))
spyOn(cardC, 'update').andReturn(new Promise((resolve, reject) -> [resolveC, rejectC] = [resolve, reject]))
Expand All @@ -93,6 +97,7 @@ describe 'UpdatesPanel', ->
runs ->
notifications = atom.notifications.getNotifications()
expect(notifications.length).toBe 1
expect(notifications[0].options.detail).toBe 'test-package-a@1.0.0 -> 99.0.0\ntest-package-b@1.0.0 -> 99.0.0\ntest-package-c@cf23df22 -> a296114f'

spyOn(atom, 'restartApplication')
notifications[0].options.buttons[0].onDidClick()
Expand Down

0 comments on commit 8229639

Please sign in to comment.