Notification::getTimestamp()

This commit is contained in:
Ben Ogle
2014-11-24 14:43:12 -08:00
parent f3dd757537
commit 1ae8862a9c
3 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
NotificationManager = require '../src/notification-manager'
fdescribe "NotificationManager", ->
describe "NotificationManager", ->
[manager] = []
beforeEach ->

View File

@@ -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!')

View File

@@ -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: ->