File size: 4,681 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`models/channel getChannels excludes deleted channels 1`] = `
Array [
  Object {
    "communityId": "1",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "General chatter",
    "id": "1",
    "isDefault": true,
    "isPrivate": false,
    "memberCount": 5,
    "name": "General",
    "slug": "general",
  },
]
`;

exports[`models/channel getChannelsByCommunity returns correct set of channels 1`] = `
Array [
  Object {
    "archivedAt": 2016-12-31T23:00:00.000Z,
    "communityId": "1",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "Testing archiving",
    "id": "5",
    "isDefault": true,
    "isPrivate": false,
    "memberCount": 3,
    "name": "Archived",
    "slug": "archived",
  },
  Object {
    "communityId": "1",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "General chatter",
    "id": "1",
    "isDefault": true,
    "isPrivate": false,
    "memberCount": 5,
    "name": "General",
    "slug": "general",
  },
  Object {
    "communityId": "1",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "Private chatter",
    "id": "2",
    "isDefault": false,
    "isPrivate": true,
    "memberCount": 5,
    "name": "Private",
    "slug": "private",
  },
  Object {
    "communityId": "1",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "Moderator created channel",
    "id": "8",
    "isDefault": false,
    "isPrivate": false,
    "memberCount": 1,
    "name": "Moderator created",
    "slug": "moderator-created",
  },
]
`;

exports[`models/channel getChannelsByUser returns correct set of channels 1`] = `
Array [
  Object {
    "communityId": "2",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "Private chatter",
    "id": "4",
    "isBlocked": false,
    "isDefault": false,
    "isMember": true,
    "isModerator": false,
    "isOwner": false,
    "isPending": false,
    "isPrivate": true,
    "memberCount": 5,
    "name": "Private",
    "receiveNotifications": true,
    "slug": "private",
  },
  Object {
    "communityId": "5",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "General",
    "id": "11",
    "isBlocked": false,
    "isDefault": false,
    "isMember": true,
    "isModerator": false,
    "isOwner": false,
    "isPending": false,
    "isPrivate": false,
    "memberCount": 1,
    "name": "General",
    "receiveNotifications": false,
    "slug": "general",
  },
  Object {
    "communityId": "1",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "Private chatter",
    "id": "2",
    "isBlocked": false,
    "isDefault": false,
    "isMember": true,
    "isModerator": false,
    "isOwner": false,
    "isPending": false,
    "isPrivate": true,
    "memberCount": 5,
    "name": "Private",
    "receiveNotifications": true,
    "slug": "private",
  },
  Object {
    "communityId": "1",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "General chatter",
    "id": "1",
    "isBlocked": false,
    "isDefault": true,
    "isMember": true,
    "isModerator": false,
    "isOwner": false,
    "isPending": false,
    "isPrivate": false,
    "memberCount": 5,
    "name": "General",
    "receiveNotifications": true,
    "slug": "general",
  },
  Object {
    "communityId": "2",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "Payments Features",
    "id": "10",
    "isBlocked": false,
    "isDefault": false,
    "isMember": true,
    "isModerator": false,
    "isOwner": true,
    "isPending": false,
    "isPrivate": false,
    "memberCount": 5,
    "name": "Payments Features",
    "receiveNotifications": true,
    "slug": "features",
  },
  Object {
    "communityId": "2",
    "createdAt": 2016-12-31T23:00:00.000Z,
    "description": "General chatter",
    "id": "3",
    "isBlocked": false,
    "isDefault": true,
    "isMember": true,
    "isModerator": false,
    "isOwner": false,
    "isPending": false,
    "isPrivate": false,
    "memberCount": 5,
    "name": "General",
    "receiveNotifications": true,
    "slug": "general",
  },
]
`;

exports[`models/channel getChannelsByUserAndCommunity returns correct set of channels 1`] = `
Array [
  "2",
  "1",
]
`;

exports[`models/channel getChannelsThreadCounts excludes deleted channels 1`] = `
Array [
  Object {
    "group": "1",
    "reduction": 4,
  },
]
`;

exports[`models/channel getChannelsThreadCounts excludes deleted threads 1`] = `
Array [
  Object {
    "group": "1",
    "reduction": 4,
  },
  Object {
    "group": "2",
    "reduction": 3,
  },
]
`;

exports[`models/channel getPublicChannelsByCommunity returns correct set of channels 1`] = `
Array [
  "1",
  "8",
]
`;