forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotificationPreferencesSpec.coffee
More file actions
45 lines (39 loc) · 1.65 KB
/
Copy pathNotificationPreferencesSpec.coffee
File metadata and controls
45 lines (39 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
define [
'compiled/notifications/NotificationPreferences'
], (NotificationPreferences) ->
QUnit.module "NotificationPreferences"
test 'tooltip instance was added', ->
options = { update_url: "/profile/communication_update" }
nps = new NotificationPreferences(options)
$np = $('#notification-preferences')
freq = $np.find('.frequency')
inst = $(freq).tooltip('instance')
notEqual(inst, undefined)
test 'policyCellProps with email', ->
options = { update_url: "/profile/communication_update" }
nps = new NotificationPreferences(options)
category = {category: "helloworld"}
channel = {type: "email", id: 42}
props = nps.policyCellProps(category, channel)
equal(props.buttonData.length, 4)
test 'policyCellProps with sms', ->
options = { update_url: "/profile/communication_update" }
nps = new NotificationPreferences(options)
category = {category: "helloworld"}
channel = {type: "sms", id: 42}
props = nps.policyCellProps(category, channel)
equal(props.buttonData.length, 2)
test 'policyCellProps with twitter', ->
options = { update_url: "/profile/communication_update" }
nps = new NotificationPreferences(options)
category = {category: "helloworld"}
channel = {type: "twitter", id: 42}
props = nps.policyCellProps(category, channel)
equal(props.buttonData.length, 2)
test 'policyCellProps with sms', ->
options = { update_url: "/profile/communication_update" }
nps = new NotificationPreferences(options)
category = {category: "helloworld"}
channel = {type: "sms", id: 42}
props = nps.policyCellProps(category, channel)
equal(props.buttonData.length, 2)