mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Notification::getTimestamp()
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
NotificationManager = require '../src/notification-manager'
|
||||
|
||||
fdescribe "NotificationManager", ->
|
||||
describe "NotificationManager", ->
|
||||
[manager] = []
|
||||
|
||||
beforeEach ->
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
Notification = require '../src/notification'
|
||||
|
||||
fdescribe "Notification", ->
|
||||
describe "Notification", ->
|
||||
[notification] = []
|
||||
|
||||
describe "::getTimestamp()", ->
|
||||
it "returns a Date object", ->
|
||||
notification = new Notification('error', 'message!')
|
||||
expect(notification.getTimestamp() instanceof Date).toBe true
|
||||
|
||||
describe "::getIcon()", ->
|
||||
it "returns a default when no icon specified", ->
|
||||
notification = new Notification('error', 'message!')
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
module.exports =
|
||||
class Notification
|
||||
constructor: (@type, @message, @options={}) ->
|
||||
@timestamp = new Date()
|
||||
|
||||
getOptions: -> @options
|
||||
|
||||
@@ -10,6 +11,8 @@ class Notification
|
||||
|
||||
getMessage: -> @message
|
||||
|
||||
getTimestamp: -> @timestamp
|
||||
|
||||
getDetail: -> @optons.detail
|
||||
|
||||
isClosable: ->
|
||||
|
||||
Reference in New Issue
Block a user