onlyoffice-docs_integration_sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/onlyoffice/docs_integration_sdk/document_editor/config.rb +1479 -0
- data/lib/onlyoffice/docs_integration_sdk/document_editor/config_test.rb +1713 -0
- data/lib/onlyoffice/docs_integration_sdk/document_editor.rb +29 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/command.rb +417 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/command_test.rb +672 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/conversion.rb +477 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/conversion_test.rb +682 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/healthcheck.rb +101 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/healthcheck_test.rb +209 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/jwt.rb +116 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/jwt_test.rb +70 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/response.rb +73 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/response_test.rb +49 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/service.rb +44 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/ua.rb +31 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client/ua_test.rb +35 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client.rb +321 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server/client_test.rb +1259 -0
- data/lib/onlyoffice/docs_integration_sdk/document_server.rb +29 -0
- data/lib/onlyoffice/docs_integration_sdk/document_storage/callback.rb +276 -0
- data/lib/onlyoffice/docs_integration_sdk/document_storage/callback_test.rb +291 -0
- data/lib/onlyoffice/docs_integration_sdk/document_storage.rb +29 -0
- data/lib/onlyoffice/docs_integration_sdk/jwt.rb +448 -0
- data/lib/onlyoffice/docs_integration_sdk/jwt_test.rb +598 -0
- data/lib/onlyoffice/docs_integration_sdk/test_test.rb +113 -0
- data/lib/onlyoffice/docs_integration_sdk/version.rb +26 -0
- data/lib/onlyoffice/docs_integration_sdk/version_test.rb +33 -0
- data/lib/onlyoffice/docs_integration_sdk.rb +31 -0
- data/lib/onlyoffice.rb +21 -0
- metadata +283 -0
@@ -0,0 +1,1713 @@
|
|
1
|
+
#
|
2
|
+
# (c) Copyright Ascensio System SIA 2025
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
# typed: strict
|
18
|
+
# frozen_string_literal: true
|
19
|
+
|
20
|
+
require "test/unit"
|
21
|
+
require_relative "../test_test"
|
22
|
+
require_relative "config"
|
23
|
+
|
24
|
+
module Onlyoffice
|
25
|
+
module DocsIntegrationSdk
|
26
|
+
module DocumentEditor
|
27
|
+
class Config
|
28
|
+
class DocumentTypeTest < ::Test::Unit::TestCase
|
29
|
+
extend T::Sig
|
30
|
+
include Test::BasicEnumMarshalling
|
31
|
+
|
32
|
+
sig {override.returns(T::Array[[String, DocumentType]])}
|
33
|
+
def cases
|
34
|
+
[
|
35
|
+
["word", DocumentType::Word],
|
36
|
+
["cell", DocumentType::Cell],
|
37
|
+
["slide", DocumentType::Slide],
|
38
|
+
["pdf", DocumentType::Pdf],
|
39
|
+
["text", DocumentType::Text],
|
40
|
+
["spreadsheet", DocumentType::Spreadsheet],
|
41
|
+
["presentation", DocumentType::Presentation],
|
42
|
+
]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class TypeTest < ::Test::Unit::TestCase
|
47
|
+
extend T::Sig
|
48
|
+
include Test::BasicEnumMarshalling
|
49
|
+
|
50
|
+
sig {override.returns(T::Array[[String, Type]])}
|
51
|
+
def cases
|
52
|
+
[
|
53
|
+
["desktop", Type::Desktop],
|
54
|
+
["mobile", Type::Mobile],
|
55
|
+
["embedded", Type::Embedded],
|
56
|
+
]
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
class Document
|
61
|
+
class ReferenceDataTest < ::Test::Unit::TestCase
|
62
|
+
extend T::Sig
|
63
|
+
include Test::StructMarshalling
|
64
|
+
|
65
|
+
sig {override.returns(T::Array[[T.untyped, ReferenceData]])}
|
66
|
+
def cases
|
67
|
+
[
|
68
|
+
[
|
69
|
+
{},
|
70
|
+
ReferenceData.new,
|
71
|
+
],
|
72
|
+
[
|
73
|
+
{
|
74
|
+
"fileKey" => "***",
|
75
|
+
"instanceId" => "42",
|
76
|
+
"key" => "***",
|
77
|
+
},
|
78
|
+
ReferenceData.new(
|
79
|
+
file_key: "***",
|
80
|
+
instance_id: "42",
|
81
|
+
key: "***",
|
82
|
+
),
|
83
|
+
],
|
84
|
+
]
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
class Info
|
89
|
+
class SharingSettings
|
90
|
+
class PermissionsTest < ::Test::Unit::TestCase
|
91
|
+
extend T::Sig
|
92
|
+
include Test::BasicEnumMarshalling
|
93
|
+
|
94
|
+
sig {override.returns(T::Array[[String, Permissions]])}
|
95
|
+
def cases
|
96
|
+
[
|
97
|
+
["Full Access", Permissions::FullAccess],
|
98
|
+
["Read Only", Permissions::ReadOnly],
|
99
|
+
["Deny Access", Permissions::DenyAccess],
|
100
|
+
]
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
class SharingSettingsTest < ::Test::Unit::TestCase
|
106
|
+
extend T::Sig
|
107
|
+
include Test::StructMarshalling
|
108
|
+
|
109
|
+
sig {override.returns(T::Array[[T.untyped, SharingSettings]])}
|
110
|
+
def cases
|
111
|
+
[
|
112
|
+
[
|
113
|
+
{},
|
114
|
+
SharingSettings.new,
|
115
|
+
],
|
116
|
+
[
|
117
|
+
{
|
118
|
+
"isLink" => true,
|
119
|
+
"permissions" => "Full Access",
|
120
|
+
"user" => "user_1",
|
121
|
+
},
|
122
|
+
SharingSettings.new(
|
123
|
+
is_link: true,
|
124
|
+
permissions: SharingSettings::Permissions::FullAccess,
|
125
|
+
user: "user_1",
|
126
|
+
)
|
127
|
+
],
|
128
|
+
]
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
class InfoTest < ::Test::Unit::TestCase
|
134
|
+
extend T::Sig
|
135
|
+
include Test::StructMarshalling
|
136
|
+
|
137
|
+
sig {override.returns(T::Array[[T.untyped, Info]])}
|
138
|
+
def cases
|
139
|
+
[
|
140
|
+
[
|
141
|
+
{},
|
142
|
+
Info.new,
|
143
|
+
],
|
144
|
+
[
|
145
|
+
{
|
146
|
+
"author" => "author_1",
|
147
|
+
"created" => "2025-01-01T00:00:00Z",
|
148
|
+
"favorite" => true,
|
149
|
+
"folder" => "folder_1",
|
150
|
+
"owner" => "owner_1",
|
151
|
+
"sharingSettings" => [
|
152
|
+
{
|
153
|
+
"isLink" => true,
|
154
|
+
},
|
155
|
+
],
|
156
|
+
"uploaded" => "2025-01-01T00:00:00Z",
|
157
|
+
},
|
158
|
+
Info.new(
|
159
|
+
author: "author_1",
|
160
|
+
created: "2025-01-01T00:00:00Z",
|
161
|
+
favorite: true,
|
162
|
+
folder: "folder_1",
|
163
|
+
owner: "owner_1",
|
164
|
+
sharing_settings: [
|
165
|
+
Info::SharingSettings.new(
|
166
|
+
is_link: true,
|
167
|
+
),
|
168
|
+
],
|
169
|
+
uploaded: "2025-01-01T00:00:00Z",
|
170
|
+
),
|
171
|
+
],
|
172
|
+
]
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
class Permissions
|
177
|
+
class CommentGroupTest < ::Test::Unit::TestCase
|
178
|
+
extend T::Sig
|
179
|
+
include Test::StructMarshalling
|
180
|
+
|
181
|
+
sig {override.returns(T::Array[[T.untyped, CommentGroup]])}
|
182
|
+
def cases
|
183
|
+
[
|
184
|
+
[
|
185
|
+
{},
|
186
|
+
CommentGroup.new,
|
187
|
+
],
|
188
|
+
[
|
189
|
+
{
|
190
|
+
"edit" => ["group_1"],
|
191
|
+
"remove" => ["group_1"],
|
192
|
+
"view" => ["group_1"],
|
193
|
+
},
|
194
|
+
CommentGroup.new(
|
195
|
+
edit: ["group_1"],
|
196
|
+
remove: ["group_1"],
|
197
|
+
view: ["group_1"],
|
198
|
+
),
|
199
|
+
],
|
200
|
+
]
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
class PermissionsTest < ::Test::Unit::TestCase
|
206
|
+
extend T::Sig
|
207
|
+
include Test::StructMarshalling
|
208
|
+
|
209
|
+
sig {override.returns(T::Array[[T.untyped, Permissions]])}
|
210
|
+
def cases
|
211
|
+
[
|
212
|
+
[
|
213
|
+
{},
|
214
|
+
Permissions.new,
|
215
|
+
],
|
216
|
+
[
|
217
|
+
{
|
218
|
+
"changeHistory" => true,
|
219
|
+
"chat" => true,
|
220
|
+
"comment" => true,
|
221
|
+
"commentGroups" => [
|
222
|
+
{
|
223
|
+
"edit" => ["group_1"],
|
224
|
+
},
|
225
|
+
],
|
226
|
+
"copy" => true,
|
227
|
+
"deleteCommentAuthorOnly" => true,
|
228
|
+
"download" => true,
|
229
|
+
"edit" => true,
|
230
|
+
"editCommentAuthorOnly" => true,
|
231
|
+
"fillForms" => true,
|
232
|
+
"modifyContentControl" => true,
|
233
|
+
"modifyFilter" => true,
|
234
|
+
"print" => true,
|
235
|
+
"protect" => true,
|
236
|
+
"rename" => true,
|
237
|
+
"review" => true,
|
238
|
+
"reviewGroups" => ["group_1"],
|
239
|
+
"userInfoGroups" => ["group_1"],
|
240
|
+
},
|
241
|
+
Permissions.new(
|
242
|
+
change_history: true,
|
243
|
+
chat: true,
|
244
|
+
comment: true,
|
245
|
+
comment_groups: [
|
246
|
+
Permissions::CommentGroup.new(
|
247
|
+
edit: ["group_1"],
|
248
|
+
),
|
249
|
+
],
|
250
|
+
copy: true,
|
251
|
+
delete_comment_author_only: true,
|
252
|
+
download: true,
|
253
|
+
edit: true,
|
254
|
+
edit_comment_author_only: true,
|
255
|
+
fill_forms: true,
|
256
|
+
modify_content_control: true,
|
257
|
+
modify_filter: true,
|
258
|
+
print: true,
|
259
|
+
protect: true,
|
260
|
+
rename: true,
|
261
|
+
review: true,
|
262
|
+
review_groups: ["group_1"],
|
263
|
+
user_info_groups: ["group_1"],
|
264
|
+
),
|
265
|
+
],
|
266
|
+
]
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
class DocumentTest < ::Test::Unit::TestCase
|
272
|
+
extend T::Sig
|
273
|
+
include Test::StructMarshalling
|
274
|
+
|
275
|
+
sig {override.returns(T::Array[[T.untyped, Document]])}
|
276
|
+
def cases
|
277
|
+
[
|
278
|
+
[
|
279
|
+
{},
|
280
|
+
Document.new,
|
281
|
+
],
|
282
|
+
[
|
283
|
+
{
|
284
|
+
"fileType" => "docx",
|
285
|
+
"key" => "***",
|
286
|
+
"referenceData" => {
|
287
|
+
"fileKey" => "***",
|
288
|
+
},
|
289
|
+
"title" => "Document",
|
290
|
+
"url" => "http://localhost:8080/",
|
291
|
+
"info" => {
|
292
|
+
"author" => "author_1",
|
293
|
+
},
|
294
|
+
"permissions" => {
|
295
|
+
"changeHistory" => true,
|
296
|
+
},
|
297
|
+
},
|
298
|
+
Document.new(
|
299
|
+
file_type: "docx",
|
300
|
+
key: "***",
|
301
|
+
reference_data: Document::ReferenceData.new(
|
302
|
+
file_key: "***",
|
303
|
+
),
|
304
|
+
title: "Document",
|
305
|
+
url: "http://localhost:8080/",
|
306
|
+
info: Document::Info.new(
|
307
|
+
author: "author_1",
|
308
|
+
),
|
309
|
+
permissions: Document::Permissions.new(
|
310
|
+
change_history: true,
|
311
|
+
),
|
312
|
+
),
|
313
|
+
],
|
314
|
+
]
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
class EditorConfig
|
319
|
+
class CoEditing
|
320
|
+
class ModeTest < ::Test::Unit::TestCase
|
321
|
+
extend T::Sig
|
322
|
+
include Test::BasicEnumMarshalling
|
323
|
+
|
324
|
+
sig {override.returns(T::Array[[String, Mode]])}
|
325
|
+
def cases
|
326
|
+
[
|
327
|
+
["fast", Mode::Fast],
|
328
|
+
["strict", Mode::Strict],
|
329
|
+
]
|
330
|
+
end
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
class CoEditingTest < ::Test::Unit::TestCase
|
335
|
+
extend T::Sig
|
336
|
+
include Test::StructMarshalling
|
337
|
+
|
338
|
+
sig {override.returns(T::Array[[T.untyped, CoEditing]])}
|
339
|
+
def cases
|
340
|
+
[
|
341
|
+
[
|
342
|
+
{},
|
343
|
+
CoEditing.new,
|
344
|
+
],
|
345
|
+
[
|
346
|
+
{
|
347
|
+
"mode" => "fast",
|
348
|
+
"change" => true,
|
349
|
+
},
|
350
|
+
CoEditing.new(
|
351
|
+
mode: CoEditing::Mode::Fast,
|
352
|
+
change: true,
|
353
|
+
),
|
354
|
+
],
|
355
|
+
]
|
356
|
+
end
|
357
|
+
end
|
358
|
+
|
359
|
+
class ModeTest < ::Test::Unit::TestCase
|
360
|
+
extend T::Sig
|
361
|
+
include Test::BasicEnumMarshalling
|
362
|
+
|
363
|
+
sig {override.returns(T::Array[[String, Mode]])}
|
364
|
+
def cases
|
365
|
+
[
|
366
|
+
["view", Mode::View],
|
367
|
+
["edit", Mode::Edit],
|
368
|
+
]
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
class RecentTest < ::Test::Unit::TestCase
|
373
|
+
extend T::Sig
|
374
|
+
include Test::StructMarshalling
|
375
|
+
|
376
|
+
sig {override.returns(T::Array[[T.untyped, Recent]])}
|
377
|
+
def cases
|
378
|
+
[
|
379
|
+
[
|
380
|
+
{},
|
381
|
+
Recent.new,
|
382
|
+
],
|
383
|
+
[
|
384
|
+
{
|
385
|
+
"folder" => "folder_1",
|
386
|
+
"title" => "Document",
|
387
|
+
"url" => "http://localhost:8080/",
|
388
|
+
},
|
389
|
+
Recent.new(
|
390
|
+
folder: "folder_1",
|
391
|
+
title: "Document",
|
392
|
+
url: "http://localhost:8080/",
|
393
|
+
),
|
394
|
+
],
|
395
|
+
]
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
399
|
+
class TemplateTest < ::Test::Unit::TestCase
|
400
|
+
extend T::Sig
|
401
|
+
include Test::StructMarshalling
|
402
|
+
|
403
|
+
sig {override.returns(T::Array[[T.untyped, Template]])}
|
404
|
+
def cases
|
405
|
+
[
|
406
|
+
[
|
407
|
+
{},
|
408
|
+
Template.new,
|
409
|
+
],
|
410
|
+
[
|
411
|
+
{
|
412
|
+
"image" => "http://localhost:8080/",
|
413
|
+
"title" => "Document",
|
414
|
+
"url" => "http://localhost:8080/",
|
415
|
+
},
|
416
|
+
Template.new(
|
417
|
+
image: "http://localhost:8080/",
|
418
|
+
title: "Document",
|
419
|
+
url: "http://localhost:8080/",
|
420
|
+
),
|
421
|
+
],
|
422
|
+
]
|
423
|
+
end
|
424
|
+
end
|
425
|
+
|
426
|
+
class UserTest < ::Test::Unit::TestCase
|
427
|
+
extend T::Sig
|
428
|
+
include Test::StructMarshalling
|
429
|
+
|
430
|
+
sig {override.returns(T::Array[[T.untyped, User]])}
|
431
|
+
def cases
|
432
|
+
[
|
433
|
+
[
|
434
|
+
{},
|
435
|
+
User.new,
|
436
|
+
],
|
437
|
+
[
|
438
|
+
{
|
439
|
+
"firstname" => "First",
|
440
|
+
"group" => "group_1",
|
441
|
+
"id" => "42",
|
442
|
+
"image" => "http://localhost:8080/",
|
443
|
+
"lastname" => "Last",
|
444
|
+
"name" => "First Last",
|
445
|
+
},
|
446
|
+
User.new(
|
447
|
+
firstname: "First",
|
448
|
+
group: "group_1",
|
449
|
+
id: "42",
|
450
|
+
image: "http://localhost:8080/",
|
451
|
+
lastname: "Last",
|
452
|
+
name: "First Last",
|
453
|
+
),
|
454
|
+
],
|
455
|
+
]
|
456
|
+
end
|
457
|
+
end
|
458
|
+
|
459
|
+
class Customization
|
460
|
+
class AnonymousTest < ::Test::Unit::TestCase
|
461
|
+
extend T::Sig
|
462
|
+
include Test::StructMarshalling
|
463
|
+
|
464
|
+
sig {override.returns(T::Array[[T.untyped, Anonymous]])}
|
465
|
+
def cases
|
466
|
+
[
|
467
|
+
[
|
468
|
+
{},
|
469
|
+
Anonymous.new,
|
470
|
+
],
|
471
|
+
[
|
472
|
+
{
|
473
|
+
"request" => true,
|
474
|
+
"label" => "Anonymous",
|
475
|
+
},
|
476
|
+
Anonymous.new(
|
477
|
+
request: true,
|
478
|
+
label: "Anonymous",
|
479
|
+
),
|
480
|
+
],
|
481
|
+
]
|
482
|
+
end
|
483
|
+
end
|
484
|
+
|
485
|
+
class CloseTest < ::Test::Unit::TestCase
|
486
|
+
extend T::Sig
|
487
|
+
include Test::StructMarshalling
|
488
|
+
|
489
|
+
sig {override.returns(T::Array[[T.untyped, Close]])}
|
490
|
+
def cases
|
491
|
+
[
|
492
|
+
[
|
493
|
+
{},
|
494
|
+
Close.new,
|
495
|
+
],
|
496
|
+
[
|
497
|
+
{
|
498
|
+
"visible" => true,
|
499
|
+
"text" => "Close",
|
500
|
+
},
|
501
|
+
Close.new(
|
502
|
+
visible: true,
|
503
|
+
text: "Close",
|
504
|
+
),
|
505
|
+
],
|
506
|
+
]
|
507
|
+
end
|
508
|
+
end
|
509
|
+
|
510
|
+
class CustomerTest < ::Test::Unit::TestCase
|
511
|
+
extend T::Sig
|
512
|
+
include Test::StructMarshalling
|
513
|
+
|
514
|
+
sig {override.returns(T::Array[[T.untyped, Customer]])}
|
515
|
+
def cases
|
516
|
+
[
|
517
|
+
[
|
518
|
+
{},
|
519
|
+
Customer.new,
|
520
|
+
],
|
521
|
+
[
|
522
|
+
{
|
523
|
+
"address" => "Address",
|
524
|
+
"info" => "Info",
|
525
|
+
"logo" => "http://localhost:8080/",
|
526
|
+
"logoDark" => "http://localhost:8080/",
|
527
|
+
"mail" => "mail@localhost",
|
528
|
+
"name" => "Customer",
|
529
|
+
"phone" => "1234567890",
|
530
|
+
"www" => "http://localhost:8080/",
|
531
|
+
},
|
532
|
+
Customer.new(
|
533
|
+
address: "Address",
|
534
|
+
info: "Info",
|
535
|
+
logo: "http://localhost:8080/",
|
536
|
+
logo_dark: "http://localhost:8080/",
|
537
|
+
mail: "mail@localhost",
|
538
|
+
name: "Customer",
|
539
|
+
phone: "1234567890",
|
540
|
+
www: "http://localhost:8080/",
|
541
|
+
),
|
542
|
+
],
|
543
|
+
]
|
544
|
+
end
|
545
|
+
end
|
546
|
+
|
547
|
+
class Features
|
548
|
+
class SpellcheckTest < ::Test::Unit::TestCase
|
549
|
+
extend T::Sig
|
550
|
+
include Test::StructMarshalling
|
551
|
+
|
552
|
+
sig {override.returns(T::Array[[T.untyped, Spellcheck]])}
|
553
|
+
def cases
|
554
|
+
[
|
555
|
+
[
|
556
|
+
{},
|
557
|
+
Spellcheck.new,
|
558
|
+
],
|
559
|
+
[
|
560
|
+
{
|
561
|
+
"mode" => true,
|
562
|
+
"change" => true,
|
563
|
+
},
|
564
|
+
Spellcheck.new(
|
565
|
+
mode: true,
|
566
|
+
change: true,
|
567
|
+
),
|
568
|
+
],
|
569
|
+
]
|
570
|
+
end
|
571
|
+
end
|
572
|
+
|
573
|
+
class TabBackground
|
574
|
+
class ModeTest < ::Test::Unit::TestCase
|
575
|
+
extend T::Sig
|
576
|
+
include Test::BasicEnumMarshalling
|
577
|
+
|
578
|
+
sig {override.returns(T::Array[[String, Mode]])}
|
579
|
+
def cases
|
580
|
+
[
|
581
|
+
["header", Mode::Header],
|
582
|
+
["toolbar", Mode::Toolbar],
|
583
|
+
]
|
584
|
+
end
|
585
|
+
end
|
586
|
+
end
|
587
|
+
|
588
|
+
class TabBackgroundTest < ::Test::Unit::TestCase
|
589
|
+
extend T::Sig
|
590
|
+
include Test::StructMarshalling
|
591
|
+
|
592
|
+
sig {override.returns(T::Array[[T.untyped, TabBackground]])}
|
593
|
+
def cases
|
594
|
+
[
|
595
|
+
[
|
596
|
+
{},
|
597
|
+
TabBackground.new,
|
598
|
+
],
|
599
|
+
[
|
600
|
+
{
|
601
|
+
"mode" => "header",
|
602
|
+
"change" => true,
|
603
|
+
},
|
604
|
+
TabBackground.new(
|
605
|
+
mode: TabBackground::Mode::Header,
|
606
|
+
change: true,
|
607
|
+
),
|
608
|
+
],
|
609
|
+
]
|
610
|
+
end
|
611
|
+
end
|
612
|
+
|
613
|
+
class TabStyle
|
614
|
+
class ModeTest < ::Test::Unit::TestCase
|
615
|
+
extend T::Sig
|
616
|
+
include Test::BasicEnumMarshalling
|
617
|
+
|
618
|
+
sig {override.returns(T::Array[[String, Mode]])}
|
619
|
+
def cases
|
620
|
+
[
|
621
|
+
["fill", Mode::Fill],
|
622
|
+
["line", Mode::Line],
|
623
|
+
]
|
624
|
+
end
|
625
|
+
end
|
626
|
+
end
|
627
|
+
|
628
|
+
class TabStyleTest < ::Test::Unit::TestCase
|
629
|
+
extend T::Sig
|
630
|
+
include Test::StructMarshalling
|
631
|
+
|
632
|
+
sig {override.returns(T::Array[[T.untyped, TabStyle]])}
|
633
|
+
def cases
|
634
|
+
[
|
635
|
+
[
|
636
|
+
{},
|
637
|
+
TabStyle.new,
|
638
|
+
],
|
639
|
+
[
|
640
|
+
{
|
641
|
+
"mode" => "fill",
|
642
|
+
"change" => true,
|
643
|
+
},
|
644
|
+
TabStyle.new(
|
645
|
+
mode: TabStyle::Mode::Fill,
|
646
|
+
change: true,
|
647
|
+
),
|
648
|
+
],
|
649
|
+
]
|
650
|
+
end
|
651
|
+
end
|
652
|
+
end
|
653
|
+
|
654
|
+
class FeaturesTest < ::Test::Unit::TestCase
|
655
|
+
extend T::Sig
|
656
|
+
include Test::StructMarshalling
|
657
|
+
|
658
|
+
sig {override.returns(T::Array[[T.untyped, Features]])}
|
659
|
+
def cases
|
660
|
+
[
|
661
|
+
[
|
662
|
+
{},
|
663
|
+
Features.new,
|
664
|
+
],
|
665
|
+
[
|
666
|
+
{
|
667
|
+
"roles" => true,
|
668
|
+
"spellcheck" => true,
|
669
|
+
"tabBackground" => "header",
|
670
|
+
"tabStyle" => "fill",
|
671
|
+
},
|
672
|
+
Features.new(
|
673
|
+
roles: true,
|
674
|
+
spellcheck: true,
|
675
|
+
tab_background: Features::TabBackground::Mode::Header,
|
676
|
+
tab_style: Features::TabStyle::Mode::Fill,
|
677
|
+
),
|
678
|
+
],
|
679
|
+
[
|
680
|
+
{
|
681
|
+
"spellcheck" => {
|
682
|
+
"mode" => true,
|
683
|
+
},
|
684
|
+
"tabBackground" => {
|
685
|
+
"mode" => "header",
|
686
|
+
},
|
687
|
+
"tabStyle" => {
|
688
|
+
"mode" => "fill",
|
689
|
+
},
|
690
|
+
},
|
691
|
+
Features.new(
|
692
|
+
spellcheck: Features::Spellcheck.new(
|
693
|
+
mode: true,
|
694
|
+
),
|
695
|
+
tab_background: Features::TabBackground.new(
|
696
|
+
mode: Features::TabBackground::Mode::Header,
|
697
|
+
),
|
698
|
+
tab_style: Features::TabStyle.new(
|
699
|
+
mode: Features::TabStyle::Mode::Fill,
|
700
|
+
),
|
701
|
+
),
|
702
|
+
],
|
703
|
+
]
|
704
|
+
end
|
705
|
+
end
|
706
|
+
|
707
|
+
class FeedbackTest < ::Test::Unit::TestCase
|
708
|
+
extend T::Sig
|
709
|
+
include Test::StructMarshalling
|
710
|
+
|
711
|
+
sig {override.returns(T::Array[[T.untyped, Feedback]])}
|
712
|
+
def cases
|
713
|
+
[
|
714
|
+
[
|
715
|
+
{},
|
716
|
+
Feedback.new,
|
717
|
+
],
|
718
|
+
[
|
719
|
+
{
|
720
|
+
"url" => "http://localhost:8080/",
|
721
|
+
"visible" => true,
|
722
|
+
},
|
723
|
+
Feedback.new(
|
724
|
+
url: "http://localhost:8080/",
|
725
|
+
visible: true,
|
726
|
+
),
|
727
|
+
],
|
728
|
+
]
|
729
|
+
end
|
730
|
+
end
|
731
|
+
|
732
|
+
class FontTest < ::Test::Unit::TestCase
|
733
|
+
extend T::Sig
|
734
|
+
include Test::StructMarshalling
|
735
|
+
|
736
|
+
sig {override.returns(T::Array[[T.untyped, Font]])}
|
737
|
+
def cases
|
738
|
+
[
|
739
|
+
[
|
740
|
+
{},
|
741
|
+
Font.new,
|
742
|
+
],
|
743
|
+
[
|
744
|
+
{
|
745
|
+
"name" => "Arial",
|
746
|
+
"size" => "12px",
|
747
|
+
},
|
748
|
+
Font.new(
|
749
|
+
name: "Arial",
|
750
|
+
size: "12px",
|
751
|
+
),
|
752
|
+
],
|
753
|
+
]
|
754
|
+
end
|
755
|
+
end
|
756
|
+
|
757
|
+
class GoBackTest < ::Test::Unit::TestCase
|
758
|
+
extend T::Sig
|
759
|
+
include Test::StructMarshalling
|
760
|
+
|
761
|
+
sig {override.returns(T::Array[[T.untyped, GoBack]])}
|
762
|
+
def cases
|
763
|
+
[
|
764
|
+
[
|
765
|
+
{},
|
766
|
+
GoBack.new,
|
767
|
+
],
|
768
|
+
[
|
769
|
+
{
|
770
|
+
"blank" => true,
|
771
|
+
"requestClose" => true,
|
772
|
+
"text" => "Go Back",
|
773
|
+
"url" => "http://localhost:8080/",
|
774
|
+
},
|
775
|
+
GoBack.new(
|
776
|
+
blank: true,
|
777
|
+
request_close: true,
|
778
|
+
text: "Go Back",
|
779
|
+
url: "http://localhost:8080/",
|
780
|
+
),
|
781
|
+
],
|
782
|
+
]
|
783
|
+
end
|
784
|
+
end
|
785
|
+
|
786
|
+
class IntegrationModeTest < ::Test::Unit::TestCase
|
787
|
+
extend T::Sig
|
788
|
+
include Test::BasicEnumMarshalling
|
789
|
+
|
790
|
+
sig {override.returns(T::Array[[String, IntegrationMode]])}
|
791
|
+
def cases
|
792
|
+
[
|
793
|
+
["embed", IntegrationMode::Embed],
|
794
|
+
]
|
795
|
+
end
|
796
|
+
end
|
797
|
+
|
798
|
+
class Layout
|
799
|
+
class HeaderTest < ::Test::Unit::TestCase
|
800
|
+
extend T::Sig
|
801
|
+
include Test::StructMarshalling
|
802
|
+
|
803
|
+
sig {override.returns(T::Array[[T.untyped, Header]])}
|
804
|
+
def cases
|
805
|
+
[
|
806
|
+
[
|
807
|
+
{},
|
808
|
+
Header.new,
|
809
|
+
],
|
810
|
+
[
|
811
|
+
{
|
812
|
+
"editMode" => true,
|
813
|
+
"save" => true,
|
814
|
+
"users" => true,
|
815
|
+
},
|
816
|
+
Header.new(
|
817
|
+
edit_mode: true,
|
818
|
+
save: true,
|
819
|
+
users: true,
|
820
|
+
),
|
821
|
+
],
|
822
|
+
]
|
823
|
+
end
|
824
|
+
end
|
825
|
+
|
826
|
+
class LeftMenuTest < ::Test::Unit::TestCase
|
827
|
+
extend T::Sig
|
828
|
+
include Test::StructMarshalling
|
829
|
+
|
830
|
+
sig {override.returns(T::Array[[T.untyped, LeftMenu]])}
|
831
|
+
def cases
|
832
|
+
[
|
833
|
+
[
|
834
|
+
{},
|
835
|
+
LeftMenu.new,
|
836
|
+
],
|
837
|
+
[
|
838
|
+
{
|
839
|
+
"menu" => true,
|
840
|
+
"navigation" => true,
|
841
|
+
"spellcheck" => true,
|
842
|
+
},
|
843
|
+
LeftMenu.new(
|
844
|
+
menu: true,
|
845
|
+
navigation: true,
|
846
|
+
spellcheck: true,
|
847
|
+
),
|
848
|
+
],
|
849
|
+
]
|
850
|
+
end
|
851
|
+
end
|
852
|
+
|
853
|
+
class RightMenuTest < ::Test::Unit::TestCase
|
854
|
+
extend T::Sig
|
855
|
+
include Test::StructMarshalling
|
856
|
+
|
857
|
+
sig {override.returns(T::Array[[T.untyped, RightMenu]])}
|
858
|
+
def cases
|
859
|
+
[
|
860
|
+
[
|
861
|
+
{},
|
862
|
+
RightMenu.new,
|
863
|
+
],
|
864
|
+
[
|
865
|
+
{
|
866
|
+
"mode" => true,
|
867
|
+
},
|
868
|
+
RightMenu.new(
|
869
|
+
mode: true,
|
870
|
+
),
|
871
|
+
],
|
872
|
+
]
|
873
|
+
end
|
874
|
+
end
|
875
|
+
|
876
|
+
class StatusBarTest < ::Test::Unit::TestCase
|
877
|
+
extend T::Sig
|
878
|
+
include Test::StructMarshalling
|
879
|
+
|
880
|
+
sig {override.returns(T::Array[[T.untyped, StatusBar]])}
|
881
|
+
def cases
|
882
|
+
[
|
883
|
+
[
|
884
|
+
{},
|
885
|
+
StatusBar.new,
|
886
|
+
],
|
887
|
+
[
|
888
|
+
{
|
889
|
+
"actionStatus" => true,
|
890
|
+
"docLang" => true,
|
891
|
+
"textLang" => true,
|
892
|
+
},
|
893
|
+
StatusBar.new(
|
894
|
+
action_status: true,
|
895
|
+
doc_lang: true,
|
896
|
+
text_lang: true,
|
897
|
+
),
|
898
|
+
],
|
899
|
+
]
|
900
|
+
end
|
901
|
+
end
|
902
|
+
|
903
|
+
class Toolbar
|
904
|
+
class CollaborationTest < ::Test::Unit::TestCase
|
905
|
+
extend T::Sig
|
906
|
+
include Test::StructMarshalling
|
907
|
+
|
908
|
+
sig {override.returns(T::Array[[T.untyped, Collaboration]])}
|
909
|
+
def cases
|
910
|
+
[
|
911
|
+
[
|
912
|
+
{},
|
913
|
+
Collaboration.new,
|
914
|
+
],
|
915
|
+
[
|
916
|
+
{
|
917
|
+
"mailmerge" => true,
|
918
|
+
},
|
919
|
+
Collaboration.new(
|
920
|
+
mailmerge: true,
|
921
|
+
),
|
922
|
+
],
|
923
|
+
]
|
924
|
+
end
|
925
|
+
end
|
926
|
+
|
927
|
+
class FileTest < ::Test::Unit::TestCase
|
928
|
+
extend T::Sig
|
929
|
+
include Test::StructMarshalling
|
930
|
+
|
931
|
+
sig {override.returns(T::Array[[T.untyped, File]])}
|
932
|
+
def cases
|
933
|
+
[
|
934
|
+
[
|
935
|
+
{},
|
936
|
+
File.new,
|
937
|
+
],
|
938
|
+
[
|
939
|
+
{
|
940
|
+
"close" => true,
|
941
|
+
"info" => true,
|
942
|
+
"save" => true,
|
943
|
+
"settings" => true,
|
944
|
+
},
|
945
|
+
File.new(
|
946
|
+
close: true,
|
947
|
+
info: true,
|
948
|
+
save: true,
|
949
|
+
settings: true,
|
950
|
+
),
|
951
|
+
],
|
952
|
+
]
|
953
|
+
end
|
954
|
+
end
|
955
|
+
|
956
|
+
class HomeTest < ::Test::Unit::TestCase
|
957
|
+
extend T::Sig
|
958
|
+
include Test::StructMarshalling
|
959
|
+
|
960
|
+
sig {override.returns(T::Array[[T.untyped, Home]])}
|
961
|
+
def cases
|
962
|
+
[
|
963
|
+
[
|
964
|
+
{},
|
965
|
+
Home.new,
|
966
|
+
],
|
967
|
+
[
|
968
|
+
{
|
969
|
+
"mailmerge" => true,
|
970
|
+
},
|
971
|
+
Home.new(
|
972
|
+
mailmerge: true,
|
973
|
+
),
|
974
|
+
],
|
975
|
+
]
|
976
|
+
end
|
977
|
+
end
|
978
|
+
|
979
|
+
class ViewTest < ::Test::Unit::TestCase
|
980
|
+
extend T::Sig
|
981
|
+
include Test::StructMarshalling
|
982
|
+
|
983
|
+
sig {override.returns(T::Array[[T.untyped, View]])}
|
984
|
+
def cases
|
985
|
+
[
|
986
|
+
[
|
987
|
+
{},
|
988
|
+
View.new,
|
989
|
+
],
|
990
|
+
[
|
991
|
+
{
|
992
|
+
"navigation" => true,
|
993
|
+
},
|
994
|
+
View.new(
|
995
|
+
navigation: true,
|
996
|
+
),
|
997
|
+
],
|
998
|
+
]
|
999
|
+
end
|
1000
|
+
end
|
1001
|
+
end
|
1002
|
+
|
1003
|
+
class ToolbarTest < ::Test::Unit::TestCase
|
1004
|
+
extend T::Sig
|
1005
|
+
include Test::StructMarshalling
|
1006
|
+
|
1007
|
+
sig {override.returns(T::Array[[T.untyped, Toolbar]])}
|
1008
|
+
def cases
|
1009
|
+
[
|
1010
|
+
[
|
1011
|
+
{},
|
1012
|
+
Toolbar.new,
|
1013
|
+
],
|
1014
|
+
[
|
1015
|
+
{
|
1016
|
+
"collaboration" => true,
|
1017
|
+
"draw" => true,
|
1018
|
+
"file" => true,
|
1019
|
+
"home" => {
|
1020
|
+
"mailmerge" => true,
|
1021
|
+
},
|
1022
|
+
"layout" => true,
|
1023
|
+
"plugins" => true,
|
1024
|
+
"protect" => true,
|
1025
|
+
"references" => true,
|
1026
|
+
"save" => true,
|
1027
|
+
"view" => true,
|
1028
|
+
},
|
1029
|
+
Toolbar.new(
|
1030
|
+
collaboration: true,
|
1031
|
+
draw: true,
|
1032
|
+
file: true,
|
1033
|
+
home: Toolbar::Home.new(
|
1034
|
+
mailmerge: true,
|
1035
|
+
),
|
1036
|
+
layout: true,
|
1037
|
+
plugins: true,
|
1038
|
+
protect: true,
|
1039
|
+
references: true,
|
1040
|
+
save: true,
|
1041
|
+
view: true,
|
1042
|
+
),
|
1043
|
+
],
|
1044
|
+
[
|
1045
|
+
{
|
1046
|
+
"collaboration" => {
|
1047
|
+
"mailmerge" => true,
|
1048
|
+
},
|
1049
|
+
"file" => {
|
1050
|
+
"close" => true,
|
1051
|
+
},
|
1052
|
+
"view" => {
|
1053
|
+
"navigation" => true,
|
1054
|
+
},
|
1055
|
+
},
|
1056
|
+
Toolbar.new(
|
1057
|
+
collaboration: Toolbar::Collaboration.new(
|
1058
|
+
mailmerge: true,
|
1059
|
+
),
|
1060
|
+
file: Toolbar::File.new(
|
1061
|
+
close: true,
|
1062
|
+
),
|
1063
|
+
view: Toolbar::View.new(
|
1064
|
+
navigation: true,
|
1065
|
+
),
|
1066
|
+
),
|
1067
|
+
],
|
1068
|
+
]
|
1069
|
+
end
|
1070
|
+
end
|
1071
|
+
end
|
1072
|
+
|
1073
|
+
class LayoutTest < ::Test::Unit::TestCase
|
1074
|
+
extend T::Sig
|
1075
|
+
include Test::StructMarshalling
|
1076
|
+
|
1077
|
+
sig {override.returns(T::Array[[T.untyped, Layout]])}
|
1078
|
+
def cases
|
1079
|
+
[
|
1080
|
+
[
|
1081
|
+
{},
|
1082
|
+
Layout.new,
|
1083
|
+
],
|
1084
|
+
[
|
1085
|
+
{
|
1086
|
+
"header" => {
|
1087
|
+
"editMode" => true,
|
1088
|
+
},
|
1089
|
+
"leftMenu" => true,
|
1090
|
+
"rightMenu" => true,
|
1091
|
+
"statusBar" => true,
|
1092
|
+
"toolbar" => true,
|
1093
|
+
},
|
1094
|
+
Layout.new(
|
1095
|
+
header: Layout::Header.new(
|
1096
|
+
edit_mode: true,
|
1097
|
+
),
|
1098
|
+
left_menu: true,
|
1099
|
+
right_menu: true,
|
1100
|
+
status_bar: true,
|
1101
|
+
toolbar: true,
|
1102
|
+
),
|
1103
|
+
],
|
1104
|
+
[
|
1105
|
+
{
|
1106
|
+
"leftMenu" => {
|
1107
|
+
"menu" => true,
|
1108
|
+
},
|
1109
|
+
"rightMenu" => {
|
1110
|
+
"mode" => true,
|
1111
|
+
},
|
1112
|
+
"statusBar" => {
|
1113
|
+
"actionStatus" => true,
|
1114
|
+
},
|
1115
|
+
"toolbar" => {
|
1116
|
+
"collaboration" => {},
|
1117
|
+
},
|
1118
|
+
},
|
1119
|
+
Layout.new(
|
1120
|
+
left_menu: Layout::LeftMenu.new(
|
1121
|
+
menu: true,
|
1122
|
+
),
|
1123
|
+
right_menu: Layout::RightMenu.new(
|
1124
|
+
mode: true,
|
1125
|
+
),
|
1126
|
+
status_bar: Layout::StatusBar.new(
|
1127
|
+
action_status: true,
|
1128
|
+
),
|
1129
|
+
toolbar: Layout::Toolbar.new(
|
1130
|
+
collaboration: Layout::Toolbar::Collaboration.new,
|
1131
|
+
),
|
1132
|
+
),
|
1133
|
+
],
|
1134
|
+
]
|
1135
|
+
end
|
1136
|
+
end
|
1137
|
+
|
1138
|
+
class LogoTest < ::Test::Unit::TestCase
|
1139
|
+
extend T::Sig
|
1140
|
+
include Test::StructMarshalling
|
1141
|
+
|
1142
|
+
sig {override.returns(T::Array[[T.untyped, Logo]])}
|
1143
|
+
def cases
|
1144
|
+
[
|
1145
|
+
[
|
1146
|
+
{},
|
1147
|
+
Logo.new,
|
1148
|
+
],
|
1149
|
+
[
|
1150
|
+
{
|
1151
|
+
"image" => "http://localhost:8080/",
|
1152
|
+
"imageDark" => "http://localhost:8080/",
|
1153
|
+
"imageLight" => "http://localhost:8080/",
|
1154
|
+
"imageEmbedded" => "http://localhost:8080/",
|
1155
|
+
"url" => "http://localhost:8080/",
|
1156
|
+
"visible" => true,
|
1157
|
+
},
|
1158
|
+
Logo.new(
|
1159
|
+
image: "http://localhost:8080/",
|
1160
|
+
image_dark: "http://localhost:8080/",
|
1161
|
+
image_light: "http://localhost:8080/",
|
1162
|
+
image_embedded: "http://localhost:8080/",
|
1163
|
+
url: "http://localhost:8080/",
|
1164
|
+
visible: true,
|
1165
|
+
),
|
1166
|
+
],
|
1167
|
+
]
|
1168
|
+
end
|
1169
|
+
end
|
1170
|
+
|
1171
|
+
class MacrosModeTest < ::Test::Unit::TestCase
|
1172
|
+
extend T::Sig
|
1173
|
+
include Test::BasicEnumMarshalling
|
1174
|
+
|
1175
|
+
sig {override.returns(T::Array[[String, MacrosMode]])}
|
1176
|
+
def cases
|
1177
|
+
[
|
1178
|
+
["disable", MacrosMode::Disable],
|
1179
|
+
["enable", MacrosMode::Enable],
|
1180
|
+
["warn", MacrosMode::Warn],
|
1181
|
+
]
|
1182
|
+
end
|
1183
|
+
end
|
1184
|
+
|
1185
|
+
class MobileTest < ::Test::Unit::TestCase
|
1186
|
+
extend T::Sig
|
1187
|
+
include Test::StructMarshalling
|
1188
|
+
|
1189
|
+
sig {override.returns(T::Array[[T.untyped, Mobile]])}
|
1190
|
+
def cases
|
1191
|
+
[
|
1192
|
+
[
|
1193
|
+
{},
|
1194
|
+
Mobile.new,
|
1195
|
+
],
|
1196
|
+
[
|
1197
|
+
{
|
1198
|
+
"forceView" => true,
|
1199
|
+
"info" => true,
|
1200
|
+
"standardView" => true,
|
1201
|
+
},
|
1202
|
+
Mobile.new(
|
1203
|
+
force_view: true,
|
1204
|
+
info: true,
|
1205
|
+
standard_view: true,
|
1206
|
+
),
|
1207
|
+
],
|
1208
|
+
]
|
1209
|
+
end
|
1210
|
+
end
|
1211
|
+
|
1212
|
+
class PointerModeTest < ::Test::Unit::TestCase
|
1213
|
+
extend T::Sig
|
1214
|
+
include Test::BasicEnumMarshalling
|
1215
|
+
|
1216
|
+
sig {override.returns(T::Array[[String, PointerMode]])}
|
1217
|
+
def cases
|
1218
|
+
[
|
1219
|
+
["hand", PointerMode::Hand],
|
1220
|
+
["select", PointerMode::Select],
|
1221
|
+
]
|
1222
|
+
end
|
1223
|
+
end
|
1224
|
+
|
1225
|
+
class Review
|
1226
|
+
class ReviewDisplayTest < ::Test::Unit::TestCase
|
1227
|
+
extend T::Sig
|
1228
|
+
include Test::BasicEnumMarshalling
|
1229
|
+
|
1230
|
+
sig {override.returns(T::Array[[String, ReviewDisplay]])}
|
1231
|
+
def cases
|
1232
|
+
[
|
1233
|
+
["markup", ReviewDisplay::Markup],
|
1234
|
+
["simple", ReviewDisplay::Simple],
|
1235
|
+
["final", ReviewDisplay::Final],
|
1236
|
+
["original", ReviewDisplay::Original],
|
1237
|
+
]
|
1238
|
+
end
|
1239
|
+
end
|
1240
|
+
end
|
1241
|
+
|
1242
|
+
class ReviewTest < ::Test::Unit::TestCase
|
1243
|
+
extend T::Sig
|
1244
|
+
include Test::StructMarshalling
|
1245
|
+
|
1246
|
+
sig {override.returns(T::Array[[T.untyped, Review]])}
|
1247
|
+
def cases
|
1248
|
+
[
|
1249
|
+
[
|
1250
|
+
{},
|
1251
|
+
Review.new,
|
1252
|
+
],
|
1253
|
+
[
|
1254
|
+
{
|
1255
|
+
"hideReviewDisplay" => true,
|
1256
|
+
"hoverMode" => true,
|
1257
|
+
"reviewDisplay" => "markup",
|
1258
|
+
"showReviewChanges" => true,
|
1259
|
+
"trackChanges" => true,
|
1260
|
+
},
|
1261
|
+
Review.new(
|
1262
|
+
hide_review_display: true,
|
1263
|
+
hover_mode: true,
|
1264
|
+
review_display: Review::ReviewDisplay::Markup,
|
1265
|
+
show_review_changes: true,
|
1266
|
+
track_changes: true,
|
1267
|
+
),
|
1268
|
+
],
|
1269
|
+
]
|
1270
|
+
end
|
1271
|
+
end
|
1272
|
+
|
1273
|
+
class SubmitFormTest < ::Test::Unit::TestCase
|
1274
|
+
extend T::Sig
|
1275
|
+
include Test::StructMarshalling
|
1276
|
+
|
1277
|
+
sig {override.returns(T::Array[[T.untyped, SubmitForm]])}
|
1278
|
+
def cases
|
1279
|
+
[
|
1280
|
+
[
|
1281
|
+
{},
|
1282
|
+
SubmitForm.new,
|
1283
|
+
],
|
1284
|
+
[
|
1285
|
+
{
|
1286
|
+
"visible" => true,
|
1287
|
+
"resultMessage" => "Success",
|
1288
|
+
},
|
1289
|
+
SubmitForm.new(
|
1290
|
+
visible: true,
|
1291
|
+
result_message: "Success",
|
1292
|
+
),
|
1293
|
+
],
|
1294
|
+
]
|
1295
|
+
end
|
1296
|
+
end
|
1297
|
+
|
1298
|
+
class UiThemeTest < ::Test::Unit::TestCase
|
1299
|
+
extend T::Sig
|
1300
|
+
include Test::BasicEnumMarshalling
|
1301
|
+
|
1302
|
+
sig {override.returns(T::Array[[String, UiTheme]])}
|
1303
|
+
def cases
|
1304
|
+
[
|
1305
|
+
["theme-light", UiTheme::Light],
|
1306
|
+
["theme-classic-light", UiTheme::ClassicLight],
|
1307
|
+
["theme-dark", UiTheme::Dark],
|
1308
|
+
["theme-contrast-dark", UiTheme::ContrastDark],
|
1309
|
+
["default-dark", UiTheme::DefaultDark],
|
1310
|
+
["default-light", UiTheme::DefaultLight],
|
1311
|
+
]
|
1312
|
+
end
|
1313
|
+
end
|
1314
|
+
|
1315
|
+
class UnitTest < ::Test::Unit::TestCase
|
1316
|
+
extend T::Sig
|
1317
|
+
include Test::BasicEnumMarshalling
|
1318
|
+
|
1319
|
+
sig {override.returns(T::Array[[String, Unit]])}
|
1320
|
+
def cases
|
1321
|
+
[
|
1322
|
+
["cm", Unit::Cm],
|
1323
|
+
["pt", Unit::Pt],
|
1324
|
+
["inch", Unit::Inch],
|
1325
|
+
]
|
1326
|
+
end
|
1327
|
+
end
|
1328
|
+
end
|
1329
|
+
|
1330
|
+
class CustomizationTest < ::Test::Unit::TestCase
|
1331
|
+
extend T::Sig
|
1332
|
+
include Test::StructMarshalling
|
1333
|
+
|
1334
|
+
sig {override.returns(T::Array[[T.untyped, Customization]])}
|
1335
|
+
def cases
|
1336
|
+
[
|
1337
|
+
[
|
1338
|
+
{},
|
1339
|
+
Customization.new,
|
1340
|
+
],
|
1341
|
+
[
|
1342
|
+
{
|
1343
|
+
"about" => true,
|
1344
|
+
"anonymous" => {
|
1345
|
+
"request" => true,
|
1346
|
+
},
|
1347
|
+
"autosave" => true,
|
1348
|
+
"chat" => true,
|
1349
|
+
"close" => {
|
1350
|
+
"visible" => true,
|
1351
|
+
},
|
1352
|
+
"commentAuthorOnly" => true,
|
1353
|
+
"comments" => true,
|
1354
|
+
"compactHeader" => true,
|
1355
|
+
"compactToolbar" => true,
|
1356
|
+
"compatibleFeatures" => true,
|
1357
|
+
"customer" => {
|
1358
|
+
"address" => "Address",
|
1359
|
+
},
|
1360
|
+
"features" => {
|
1361
|
+
"roles" => true,
|
1362
|
+
},
|
1363
|
+
"feedback" => true,
|
1364
|
+
"font" => {
|
1365
|
+
"name" => "Arial",
|
1366
|
+
},
|
1367
|
+
"forcesave" => true,
|
1368
|
+
"goback" => {
|
1369
|
+
"blank" => true,
|
1370
|
+
},
|
1371
|
+
"help" => true,
|
1372
|
+
"hideNotes" => true,
|
1373
|
+
"hideRightMenu" => true,
|
1374
|
+
"hideRulers" => true,
|
1375
|
+
"integrationMode" => "embed",
|
1376
|
+
"layout" => {
|
1377
|
+
"header" => {},
|
1378
|
+
},
|
1379
|
+
"leftMenu" => true,
|
1380
|
+
"loaderLogo" => "http://localhost:8080/",
|
1381
|
+
"loaderName" => "Loader",
|
1382
|
+
"logo" => {
|
1383
|
+
"image" => "http://localhost:8080/",
|
1384
|
+
},
|
1385
|
+
"macros" => true,
|
1386
|
+
"macrosMode" => "disable",
|
1387
|
+
"mentionShare" => true,
|
1388
|
+
"mobile" => {
|
1389
|
+
"forceView" => true,
|
1390
|
+
},
|
1391
|
+
"mobileForceView" => true,
|
1392
|
+
"plugins" => true,
|
1393
|
+
"pointerMode" => "hand",
|
1394
|
+
"review" => {
|
1395
|
+
"hideReviewDisplay" => true,
|
1396
|
+
},
|
1397
|
+
"reviewDisplay" => "markup",
|
1398
|
+
"rightMenu" => true,
|
1399
|
+
"showReviewChanges" => true,
|
1400
|
+
"slidePlayerBackground" => "#000",
|
1401
|
+
"spellcheck" => true,
|
1402
|
+
"statusBar" => true,
|
1403
|
+
"submitForm" => true,
|
1404
|
+
"toolbar" => true,
|
1405
|
+
"toolbarHideFileName" => true,
|
1406
|
+
"toolbarNoTabs" => true,
|
1407
|
+
"trackChanges" => true,
|
1408
|
+
"uiTheme" => "theme-dark",
|
1409
|
+
"unit" => "pt",
|
1410
|
+
"wordHeadingsColor" => "#000",
|
1411
|
+
"zoom" => 100,
|
1412
|
+
},
|
1413
|
+
Customization.new(
|
1414
|
+
about: true,
|
1415
|
+
anonymous: Customization::Anonymous.new(
|
1416
|
+
request: true,
|
1417
|
+
),
|
1418
|
+
autosave: true,
|
1419
|
+
chat: true,
|
1420
|
+
close: Customization::Close.new(
|
1421
|
+
visible: true,
|
1422
|
+
),
|
1423
|
+
comment_author_only: true,
|
1424
|
+
comments: true,
|
1425
|
+
compact_header: true,
|
1426
|
+
compact_toolbar: true,
|
1427
|
+
compatible_features: true,
|
1428
|
+
customer: Customization::Customer.new(
|
1429
|
+
address: "Address",
|
1430
|
+
),
|
1431
|
+
features: Customization::Features.new(
|
1432
|
+
roles: true,
|
1433
|
+
),
|
1434
|
+
feedback: true,
|
1435
|
+
font: Customization::Font.new(
|
1436
|
+
name: "Arial",
|
1437
|
+
),
|
1438
|
+
forcesave: true,
|
1439
|
+
goback: Customization::GoBack.new(
|
1440
|
+
blank: true,
|
1441
|
+
),
|
1442
|
+
help: true,
|
1443
|
+
hide_notes: true,
|
1444
|
+
hide_right_menu: true,
|
1445
|
+
hide_rulers: true,
|
1446
|
+
integration_mode: Customization::IntegrationMode::Embed,
|
1447
|
+
layout: Customization::Layout.new(
|
1448
|
+
header: Customization::Layout::Header.new,
|
1449
|
+
),
|
1450
|
+
left_menu: true,
|
1451
|
+
loader_logo: "http://localhost:8080/",
|
1452
|
+
loader_name: "Loader",
|
1453
|
+
logo: Customization::Logo.new(
|
1454
|
+
image: "http://localhost:8080/",
|
1455
|
+
),
|
1456
|
+
macros: true,
|
1457
|
+
macros_mode: Customization::MacrosMode::Disable,
|
1458
|
+
mention_share: true,
|
1459
|
+
mobile: Customization::Mobile.new(
|
1460
|
+
force_view: true,
|
1461
|
+
),
|
1462
|
+
mobile_force_view: true,
|
1463
|
+
plugins: true,
|
1464
|
+
pointer_mode: Customization::PointerMode::Hand,
|
1465
|
+
review: Customization::Review.new(
|
1466
|
+
hide_review_display: true,
|
1467
|
+
),
|
1468
|
+
review_display: Customization::Review::ReviewDisplay::Markup,
|
1469
|
+
right_menu: true,
|
1470
|
+
show_review_changes: true,
|
1471
|
+
slide_player_background: "#000",
|
1472
|
+
spellcheck: true,
|
1473
|
+
status_bar: true,
|
1474
|
+
submit_form: true,
|
1475
|
+
toolbar: true,
|
1476
|
+
toolbar_hide_file_name: true,
|
1477
|
+
toolbar_no_tabs: true,
|
1478
|
+
track_changes: true,
|
1479
|
+
ui_theme: Customization::UiTheme::Dark,
|
1480
|
+
unit: Customization::Unit::Pt,
|
1481
|
+
word_headings_color: "#000",
|
1482
|
+
zoom: 100,
|
1483
|
+
),
|
1484
|
+
],
|
1485
|
+
[
|
1486
|
+
{
|
1487
|
+
"feedback" => {
|
1488
|
+
"url" => "http://localhost:8080/",
|
1489
|
+
},
|
1490
|
+
"submitForm" => {
|
1491
|
+
"visible" => true,
|
1492
|
+
},
|
1493
|
+
},
|
1494
|
+
Customization.new(
|
1495
|
+
feedback: Customization::Feedback.new(
|
1496
|
+
url: "http://localhost:8080/",
|
1497
|
+
),
|
1498
|
+
submit_form: Customization::SubmitForm.new(
|
1499
|
+
visible: true,
|
1500
|
+
),
|
1501
|
+
),
|
1502
|
+
],
|
1503
|
+
]
|
1504
|
+
end
|
1505
|
+
end
|
1506
|
+
|
1507
|
+
class Embedded
|
1508
|
+
class ToolbarDockedTest < ::Test::Unit::TestCase
|
1509
|
+
extend T::Sig
|
1510
|
+
include Test::BasicEnumMarshalling
|
1511
|
+
|
1512
|
+
sig {override.returns(T::Array[[String, ToolbarDocked]])}
|
1513
|
+
def cases
|
1514
|
+
[
|
1515
|
+
["top", ToolbarDocked::Top],
|
1516
|
+
["bottom", ToolbarDocked::Bottom],
|
1517
|
+
]
|
1518
|
+
end
|
1519
|
+
end
|
1520
|
+
end
|
1521
|
+
|
1522
|
+
class EmbeddedTest < ::Test::Unit::TestCase
|
1523
|
+
extend T::Sig
|
1524
|
+
include Test::StructMarshalling
|
1525
|
+
|
1526
|
+
sig {override.returns(T::Array[[T.untyped, Embedded]])}
|
1527
|
+
def cases
|
1528
|
+
[
|
1529
|
+
[
|
1530
|
+
{},
|
1531
|
+
Embedded.new,
|
1532
|
+
],
|
1533
|
+
[
|
1534
|
+
{
|
1535
|
+
"embedUrl" => "http://localhost:8080/",
|
1536
|
+
"fullscreenUrl" => "http://localhost:8080/",
|
1537
|
+
"saveUrl" => "http://localhost:8080/",
|
1538
|
+
"shareUrl" => "http://localhost:8080/",
|
1539
|
+
"toolbarDocked" => "top",
|
1540
|
+
},
|
1541
|
+
Embedded.new(
|
1542
|
+
embed_url: "http://localhost:8080/",
|
1543
|
+
fullscreen_url: "http://localhost:8080/",
|
1544
|
+
save_url: "http://localhost:8080/",
|
1545
|
+
share_url: "http://localhost:8080/",
|
1546
|
+
toolbar_docked: Embedded::ToolbarDocked::Top,
|
1547
|
+
),
|
1548
|
+
],
|
1549
|
+
]
|
1550
|
+
end
|
1551
|
+
end
|
1552
|
+
|
1553
|
+
class PluginsTest < ::Test::Unit::TestCase
|
1554
|
+
extend T::Sig
|
1555
|
+
include Test::StructMarshalling
|
1556
|
+
|
1557
|
+
sig {override.returns(T::Array[[T.untyped, Plugins]])}
|
1558
|
+
def cases
|
1559
|
+
[
|
1560
|
+
[
|
1561
|
+
{},
|
1562
|
+
Plugins.new,
|
1563
|
+
],
|
1564
|
+
[
|
1565
|
+
{
|
1566
|
+
"autostart" => ["plugin_1"],
|
1567
|
+
"options" => {},
|
1568
|
+
"pluginsData" => ["plugin_1"],
|
1569
|
+
"url" => "http://localhost:8080/",
|
1570
|
+
},
|
1571
|
+
Plugins.new(
|
1572
|
+
autostart: ["plugin_1"],
|
1573
|
+
options: {},
|
1574
|
+
plugins_data: ["plugin_1"],
|
1575
|
+
url: "http://localhost:8080/",
|
1576
|
+
),
|
1577
|
+
],
|
1578
|
+
]
|
1579
|
+
end
|
1580
|
+
end
|
1581
|
+
end
|
1582
|
+
|
1583
|
+
class EditorConfigTest < ::Test::Unit::TestCase
|
1584
|
+
extend T::Sig
|
1585
|
+
include Test::StructMarshalling
|
1586
|
+
|
1587
|
+
sig {override.returns(T::Array[[T.untyped, EditorConfig]])}
|
1588
|
+
def cases
|
1589
|
+
[
|
1590
|
+
[
|
1591
|
+
{},
|
1592
|
+
EditorConfig.new,
|
1593
|
+
],
|
1594
|
+
[
|
1595
|
+
{
|
1596
|
+
"actionLink" => {},
|
1597
|
+
"callbackUrl" => "http://localhost:8080/",
|
1598
|
+
"coEditing" => {
|
1599
|
+
"mode" => "fast",
|
1600
|
+
},
|
1601
|
+
"createUrl" => "http://localhost:8080/",
|
1602
|
+
"lang" => "en",
|
1603
|
+
"location" => "us",
|
1604
|
+
"mode" => "edit",
|
1605
|
+
"recent" => [
|
1606
|
+
{
|
1607
|
+
"folder" => "folder_1",
|
1608
|
+
},
|
1609
|
+
],
|
1610
|
+
"region" => "us",
|
1611
|
+
"templates" => [
|
1612
|
+
{
|
1613
|
+
"image" => "http://localhost:8080/",
|
1614
|
+
},
|
1615
|
+
],
|
1616
|
+
"user" => {
|
1617
|
+
"firstname" => "First",
|
1618
|
+
},
|
1619
|
+
"customization" => {
|
1620
|
+
"about" => true,
|
1621
|
+
},
|
1622
|
+
"embedded" => {
|
1623
|
+
"embedUrl" => "http://localhost:8080/",
|
1624
|
+
},
|
1625
|
+
"plugins" => {
|
1626
|
+
"autostart" => ["plugin_1"],
|
1627
|
+
},
|
1628
|
+
},
|
1629
|
+
EditorConfig.new(
|
1630
|
+
action_link: {},
|
1631
|
+
callback_url: "http://localhost:8080/",
|
1632
|
+
co_editing: EditorConfig::CoEditing.new(
|
1633
|
+
mode: EditorConfig::CoEditing::Mode::Fast,
|
1634
|
+
),
|
1635
|
+
create_url: "http://localhost:8080/",
|
1636
|
+
lang: "en",
|
1637
|
+
location: "us",
|
1638
|
+
mode: EditorConfig::Mode::Edit,
|
1639
|
+
recent: [
|
1640
|
+
EditorConfig::Recent.new(
|
1641
|
+
folder: "folder_1",
|
1642
|
+
),
|
1643
|
+
],
|
1644
|
+
region: "us",
|
1645
|
+
templates: [
|
1646
|
+
EditorConfig::Template.new(
|
1647
|
+
image: "http://localhost:8080/",
|
1648
|
+
),
|
1649
|
+
],
|
1650
|
+
user: EditorConfig::User.new(
|
1651
|
+
firstname: "First",
|
1652
|
+
),
|
1653
|
+
customization: EditorConfig::Customization.new(
|
1654
|
+
about: true,
|
1655
|
+
),
|
1656
|
+
embedded: EditorConfig::Embedded.new(
|
1657
|
+
embed_url: "http://localhost:8080/",
|
1658
|
+
),
|
1659
|
+
plugins: EditorConfig::Plugins.new(
|
1660
|
+
autostart: ["plugin_1"],
|
1661
|
+
),
|
1662
|
+
),
|
1663
|
+
],
|
1664
|
+
]
|
1665
|
+
end
|
1666
|
+
end
|
1667
|
+
end
|
1668
|
+
|
1669
|
+
class ConfigTest < ::Test::Unit::TestCase
|
1670
|
+
extend T::Sig
|
1671
|
+
include Test::StructMarshalling
|
1672
|
+
|
1673
|
+
sig {override.returns(T::Array[[T.untyped, Config]])}
|
1674
|
+
def cases
|
1675
|
+
[
|
1676
|
+
[
|
1677
|
+
{},
|
1678
|
+
Config.new,
|
1679
|
+
],
|
1680
|
+
[
|
1681
|
+
{
|
1682
|
+
"documentType" => "text",
|
1683
|
+
"height" => "100%",
|
1684
|
+
"token" => "***",
|
1685
|
+
"type" => "desktop",
|
1686
|
+
"width" => "100%",
|
1687
|
+
"document" => {
|
1688
|
+
"fileType" => "docx",
|
1689
|
+
},
|
1690
|
+
"editorConfig" => {
|
1691
|
+
"actionLink" => {},
|
1692
|
+
},
|
1693
|
+
},
|
1694
|
+
Config.new(
|
1695
|
+
document_type: Config::DocumentType::Text,
|
1696
|
+
height: "100%",
|
1697
|
+
token: "***",
|
1698
|
+
type: Config::Type::Desktop,
|
1699
|
+
width: "100%",
|
1700
|
+
document: Config::Document.new(
|
1701
|
+
file_type: "docx",
|
1702
|
+
),
|
1703
|
+
editor_config: Config::EditorConfig.new(
|
1704
|
+
action_link: {},
|
1705
|
+
),
|
1706
|
+
),
|
1707
|
+
],
|
1708
|
+
]
|
1709
|
+
end
|
1710
|
+
end
|
1711
|
+
end
|
1712
|
+
end
|
1713
|
+
end
|