@@ -59,6 +59,7 @@ describe('FeatureService', () => {
59
59
planName : SubscriptionName . CorePlan ,
60
60
endsAt : 555 ,
61
61
user : Promise . resolve ( user ) ,
62
+ cancelled : false ,
62
63
}
63
64
64
65
subscription2 = {
@@ -68,6 +69,7 @@ describe('FeatureService', () => {
68
69
planName : SubscriptionName . ProPlan ,
69
70
endsAt : 777 ,
70
71
user : Promise . resolve ( user ) ,
72
+ cancelled : false ,
71
73
}
72
74
73
75
user = {
@@ -85,27 +87,27 @@ describe('FeatureService', () => {
85
87
settingService . findSetting = jest . fn ( ) . mockReturnValue ( extensionKeySetting )
86
88
} )
87
89
88
- it ( 'should return user features with `expiresAt ` field' , async ( ) => {
90
+ it ( 'should return user features with `expires_at ` field' , async ( ) => {
89
91
expect ( await createService ( ) . getFeaturesForUser ( user ) ) . toEqual ( [
90
92
{
91
- 'contentType ' : 'SN|Theme' ,
93
+ 'content_type ' : 'SN|Theme' ,
92
94
'description' : 'A theme for writers and readers.' ,
93
- 'dockIcon ' : {
94
- 'backgroundColor ' : '#9D7441' ,
95
- 'borderColor ' : '#9D7441' ,
96
- 'foregroundColor ' : '#ECE4DB' ,
95
+ 'dock_icon ' : {
96
+ 'background_color ' : '#9D7441' ,
97
+ 'border_color ' : '#9D7441' ,
98
+ 'foreground_color ' : '#ECE4DB' ,
97
99
'type' : 'circle' ,
98
100
} ,
99
- 'downloadUrl ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
100
- 'expiresAt ' : 555 ,
101
+ 'download_url ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
102
+ 'expires_at ' : 555 ,
101
103
'flags' : [
102
104
'New' ,
103
105
] ,
104
106
'identifier' : 'org.standardnotes.theme-autobiography' ,
105
- 'permissionName ' : 'theme:autobiography' ,
106
- 'marketingUrl ' : '' ,
107
+ 'permission_name ' : 'theme:autobiography' ,
108
+ 'marketing_url ' : '' ,
107
109
'name' : 'Autobiography' ,
108
- 'thumbnailUrl ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
110
+ 'thumbnail_url ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
109
111
'url' : 'https://extension-server/abc123/themes/autobiography' ,
110
112
'version' : '1.0.0' ,
111
113
} ,
@@ -129,24 +131,24 @@ describe('FeatureService', () => {
129
131
130
132
expect ( await createService ( ) . getFeaturesForUser ( user ) ) . toEqual ( [
131
133
{
132
- 'contentType ' : 'SN|Theme' ,
134
+ 'content_type ' : 'SN|Theme' ,
133
135
'description' : 'A theme for writers and readers.' ,
134
- 'dockIcon ' : {
135
- 'backgroundColor ' : '#9D7441' ,
136
- 'borderColor ' : '#9D7441' ,
137
- 'foregroundColor ' : '#ECE4DB' ,
136
+ 'dock_icon ' : {
137
+ 'background_color ' : '#9D7441' ,
138
+ 'border_color ' : '#9D7441' ,
139
+ 'foreground_color ' : '#ECE4DB' ,
138
140
'type' : 'circle' ,
139
141
} ,
140
- 'downloadUrl ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
141
- 'expiresAt ' : 555 ,
142
+ 'download_url ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
143
+ 'expires_at ' : 555 ,
142
144
'flags' : [
143
145
'New' ,
144
146
] ,
145
147
'identifier' : 'org.standardnotes.theme-autobiography' ,
146
- 'permissionName ' : 'theme:autobiography' ,
147
- 'marketingUrl ' : '' ,
148
+ 'permission_name ' : 'theme:autobiography' ,
149
+ 'marketing_url ' : '' ,
148
150
'name' : 'Autobiography' ,
149
- 'thumbnailUrl ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
151
+ 'thumbnail_url ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
150
152
'url' : '#{url_prefix}/themes/autobiography' ,
151
153
'version' : '1.0.0' ,
152
154
} ,
@@ -158,31 +160,31 @@ describe('FeatureService', () => {
158
160
159
161
expect ( await createService ( ) . getFeaturesForUser ( user ) ) . toEqual ( [
160
162
{
161
- 'contentType ' : 'SN|Theme' ,
163
+ 'content_type ' : 'SN|Theme' ,
162
164
'description' : 'A theme for writers and readers.' ,
163
- 'dockIcon ' : {
164
- 'backgroundColor ' : '#9D7441' ,
165
- 'borderColor ' : '#9D7441' ,
166
- 'foregroundColor ' : '#ECE4DB' ,
165
+ 'dock_icon ' : {
166
+ 'background_color ' : '#9D7441' ,
167
+ 'border_color ' : '#9D7441' ,
168
+ 'foreground_color ' : '#ECE4DB' ,
167
169
'type' : 'circle' ,
168
170
} ,
169
- 'downloadUrl ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
170
- 'expiresAt ' : 555 ,
171
+ 'download_url ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
172
+ 'expires_at ' : 555 ,
171
173
'flags' : [
172
174
'New' ,
173
175
] ,
174
176
'identifier' : 'org.standardnotes.theme-autobiography' ,
175
- 'permissionName ' : 'theme:autobiography' ,
176
- 'marketingUrl ' : '' ,
177
+ 'permission_name ' : 'theme:autobiography' ,
178
+ 'marketing_url ' : '' ,
177
179
'name' : 'Autobiography' ,
178
- 'thumbnailUrl ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
180
+ 'thumbnail_url ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
179
181
'url' : '#{url_prefix}/themes/autobiography' ,
180
182
'version' : '1.0.0' ,
181
183
} ,
182
184
] )
183
185
} )
184
186
185
- it ( 'should return user features with `expiresAt ` field when user has more than 1 role & subscription' , async ( ) => {
187
+ it ( 'should return user features with `expires_at ` field when user has more than 1 role & subscription' , async ( ) => {
186
188
roleToSubscriptionMap . getSubscriptionNameForRoleName = jest . fn ( )
187
189
. mockReturnValueOnce ( SubscriptionName . CorePlan )
188
190
. mockReturnValueOnce ( SubscriptionName . ProPlan )
@@ -195,39 +197,39 @@ describe('FeatureService', () => {
195
197
196
198
expect ( await createService ( ) . getFeaturesForUser ( user ) ) . toEqual ( [
197
199
{
198
- 'contentType ' : 'SN|Theme' ,
200
+ 'content_type ' : 'SN|Theme' ,
199
201
'description' : 'A theme for writers and readers.' ,
200
- 'dockIcon ' : {
201
- 'backgroundColor ' : '#9D7441' ,
202
- 'borderColor ' : '#9D7441' ,
203
- 'foregroundColor ' : '#ECE4DB' ,
202
+ 'dock_icon ' : {
203
+ 'background_color ' : '#9D7441' ,
204
+ 'border_color ' : '#9D7441' ,
205
+ 'foreground_color ' : '#ECE4DB' ,
204
206
'type' : 'circle' ,
205
207
} ,
206
- 'downloadUrl ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
207
- 'expiresAt ' : 555 ,
208
+ 'download_url ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
209
+ 'expires_at ' : 555 ,
208
210
'flags' : [
209
211
'New' ,
210
212
] ,
211
213
'identifier' : 'org.standardnotes.theme-autobiography' ,
212
- 'permissionName ' : 'theme:autobiography' ,
213
- 'marketingUrl ' : '' ,
214
+ 'permission_name ' : 'theme:autobiography' ,
215
+ 'marketing_url ' : '' ,
214
216
'name' : 'Autobiography' ,
215
- 'thumbnailUrl ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
217
+ 'thumbnail_url ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
216
218
'url' : 'https://extension-server/abc123/themes/autobiography' ,
217
219
'version' : '1.0.0' ,
218
220
} ,
219
221
{
220
222
'area' : 'modal' ,
221
- 'contentType ' : 'SN|Component' ,
222
- 'description' : '' ,
223
- 'downloadUrl ' : '' ,
224
- 'expiresAt ' : 777 ,
223
+ 'content_type ' : 'SN|Component' ,
224
+ 'description' : 'Manage and install cloud backups, including Note History, Dropbox, Google Drive, OneDrive, and Daily Email Backups. ' ,
225
+ 'download_url ' : '' ,
226
+ 'expires_at ' : 777 ,
225
227
'identifier' : 'org.standardnotes.cloudlink' ,
226
- 'permissionName ' : 'component:cloud-link' ,
227
- 'marketingUrl ' : '' ,
228
- 'name' : '' ,
229
- 'url' : '' ,
230
- 'version' : '' ,
228
+ 'permission_name ' : 'component:cloud-link' ,
229
+ 'marketing_url ' : '' ,
230
+ 'name' : 'CloudLink ' ,
231
+ 'url' : 'https://extension-server/abc123/components/cloudlink ' ,
232
+ 'version' : '1.2.3 ' ,
231
233
} ,
232
234
] )
233
235
} )
@@ -249,39 +251,39 @@ describe('FeatureService', () => {
249
251
250
252
expect ( await createService ( ) . getFeaturesForUser ( user ) ) . toEqual ( [
251
253
{
252
- 'contentType ' : 'SN|Theme' ,
254
+ 'content_type ' : 'SN|Theme' ,
253
255
'description' : 'A theme for writers and readers.' ,
254
- 'dockIcon ' : {
255
- 'backgroundColor ' : '#9D7441' ,
256
- 'borderColor ' : '#9D7441' ,
257
- 'foregroundColor ' : '#ECE4DB' ,
256
+ 'dock_icon ' : {
257
+ 'background_color ' : '#9D7441' ,
258
+ 'border_color ' : '#9D7441' ,
259
+ 'foreground_color ' : '#ECE4DB' ,
258
260
'type' : 'circle' ,
259
261
} ,
260
- 'downloadUrl ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
261
- 'expiresAt ' : 777 ,
262
+ 'download_url ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
263
+ 'expires_at ' : 777 ,
262
264
'flags' : [
263
265
'New' ,
264
266
] ,
265
267
'identifier' : 'org.standardnotes.theme-autobiography' ,
266
- 'permissionName ' : 'theme:autobiography' ,
267
- 'marketingUrl ' : '' ,
268
+ 'permission_name ' : 'theme:autobiography' ,
269
+ 'marketing_url ' : '' ,
268
270
'name' : 'Autobiography' ,
269
- 'thumbnailUrl ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
271
+ 'thumbnail_url ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
270
272
'url' : 'https://extension-server/abc123/themes/autobiography' ,
271
273
'version' : '1.0.0' ,
272
274
} ,
273
275
{
274
276
'area' : 'modal' ,
275
- 'contentType ' : 'SN|Component' ,
276
- 'description' : '' ,
277
- 'downloadUrl ' : '' ,
278
- 'expiresAt ' : 777 ,
277
+ 'content_type ' : 'SN|Component' ,
278
+ 'description' : 'Manage and install cloud backups, including Note History, Dropbox, Google Drive, OneDrive, and Daily Email Backups. ' ,
279
+ 'download_url ' : '' ,
280
+ 'expires_at ' : 777 ,
279
281
'identifier' : 'org.standardnotes.cloudlink' ,
280
- 'permissionName ' : 'component:cloud-link' ,
281
- 'marketingUrl ' : '' ,
282
- 'name' : '' ,
283
- 'url' : '' ,
284
- 'version' : '' ,
282
+ 'permission_name ' : 'component:cloud-link' ,
283
+ 'marketing_url ' : '' ,
284
+ 'name' : 'CloudLink ' ,
285
+ 'url' : 'https://extension-server/abc123/components/cloudlink ' ,
286
+ 'version' : '1.2.3 ' ,
285
287
} ,
286
288
] )
287
289
} )
@@ -305,39 +307,39 @@ describe('FeatureService', () => {
305
307
306
308
expect ( await createService ( ) . getFeaturesForUser ( user ) ) . toEqual ( [
307
309
{
308
- 'contentType ' : 'SN|Theme' ,
310
+ 'content_type ' : 'SN|Theme' ,
309
311
'description' : 'A theme for writers and readers.' ,
310
- 'dockIcon ' : {
311
- 'backgroundColor ' : '#9D7441' ,
312
- 'borderColor ' : '#9D7441' ,
313
- 'foregroundColor ' : '#ECE4DB' ,
312
+ 'dock_icon ' : {
313
+ 'background_color ' : '#9D7441' ,
314
+ 'border_color ' : '#9D7441' ,
315
+ 'foreground_color ' : '#ECE4DB' ,
314
316
'type' : 'circle' ,
315
317
} ,
316
- 'downloadUrl ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
317
- 'expiresAt ' : 555 ,
318
+ 'download_url ' : 'https://github.com/standardnotes/autobiography-theme/archive/1.0.0.zip' ,
319
+ 'expires_at ' : 555 ,
318
320
'flags' : [
319
321
'New' ,
320
322
] ,
321
323
'identifier' : 'org.standardnotes.theme-autobiography' ,
322
- 'permissionName ' : 'theme:autobiography' ,
323
- 'marketingUrl ' : '' ,
324
+ 'permission_name ' : 'theme:autobiography' ,
325
+ 'marketing_url ' : '' ,
324
326
'name' : 'Autobiography' ,
325
- 'thumbnailUrl ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
327
+ 'thumbnail_url ' : 'https://s3.amazonaws.com/standard-notes/screenshots/models/themes/autobiography.jpg' ,
326
328
'url' : 'https://extension-server/abc123/themes/autobiography' ,
327
329
'version' : '1.0.0' ,
328
330
} ,
329
331
{
330
332
'area' : 'modal' ,
331
- 'contentType ' : 'SN|Component' ,
332
- 'description' : '' ,
333
- 'downloadUrl ' : '' ,
334
- 'expiresAt ' : 111 ,
333
+ 'content_type ' : 'SN|Component' ,
334
+ 'description' : 'Manage and install cloud backups, including Note History, Dropbox, Google Drive, OneDrive, and Daily Email Backups. ' ,
335
+ 'download_url ' : '' ,
336
+ 'expires_at ' : 111 ,
335
337
'identifier' : 'org.standardnotes.cloudlink' ,
336
- 'permissionName ' : 'component:cloud-link' ,
337
- 'marketingUrl ' : '' ,
338
- 'name' : '' ,
339
- 'url' : '' ,
340
- 'version' : '' ,
338
+ 'permission_name ' : 'component:cloud-link' ,
339
+ 'marketing_url ' : '' ,
340
+ 'name' : 'CloudLink ' ,
341
+ 'url' : 'https://extension-server/abc123/components/cloudlink ' ,
342
+ 'version' : '1.2.3 ' ,
341
343
} ,
342
344
] )
343
345
} )
0 commit comments