|
@@ -41,8 +41,10 @@ class TestWorkspaceEndpoint(FunctionalTest):
|
41
|
41
|
assert workspace['slug'] == 'business'
|
42
|
42
|
assert workspace['label'] == 'Business'
|
43
|
43
|
assert workspace['description'] == 'All importants documents'
|
44
|
|
- assert len(workspace['sidebar_entries']) == 7
|
|
44
|
+ assert len(workspace['sidebar_entries']) == 5
|
45
|
45
|
|
|
46
|
+ # TODO - G.M - 2018-08-02 - Better test for sidebar entry, make it
|
|
47
|
+ # not fixed on active application/content-file
|
46
|
48
|
sidebar_entry = workspace['sidebar_entries'][0]
|
47
|
49
|
assert sidebar_entry['slug'] == 'dashboard'
|
48
|
50
|
assert sidebar_entry['label'] == 'Dashboard'
|
|
@@ -65,33 +67,19 @@ class TestWorkspaceEndpoint(FunctionalTest):
|
65
|
67
|
assert sidebar_entry['fa_icon'] == "file-text-o"
|
66
|
68
|
|
67
|
69
|
sidebar_entry = workspace['sidebar_entries'][3]
|
68
|
|
- assert sidebar_entry['slug'] == 'contents/markdownpluspage'
|
69
|
|
- assert sidebar_entry['label'] == 'Markdown Plus Documents'
|
70
|
|
- assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=markdownpluspage" # nopep8
|
71
|
|
- assert sidebar_entry['hexcolor'] == "#f12d2d"
|
72
|
|
- assert sidebar_entry['fa_icon'] == "file-code-o"
|
73
|
|
-
|
74
|
|
- sidebar_entry = workspace['sidebar_entries'][4]
|
75
|
70
|
assert sidebar_entry['slug'] == 'contents/file'
|
76
|
71
|
assert sidebar_entry['label'] == 'Files'
|
77
|
72
|
assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file" # nopep8
|
78
|
73
|
assert sidebar_entry['hexcolor'] == "#FF9900"
|
79
|
74
|
assert sidebar_entry['fa_icon'] == "paperclip"
|
80
|
75
|
|
81
|
|
- sidebar_entry = workspace['sidebar_entries'][5]
|
|
76
|
+ sidebar_entry = workspace['sidebar_entries'][4]
|
82
|
77
|
assert sidebar_entry['slug'] == 'contents/thread'
|
83
|
78
|
assert sidebar_entry['label'] == 'Threads'
|
84
|
79
|
assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread" # nopep8
|
85
|
80
|
assert sidebar_entry['hexcolor'] == "#ad4cf9"
|
86
|
81
|
assert sidebar_entry['fa_icon'] == "comments-o"
|
87
|
82
|
|
88
|
|
- sidebar_entry = workspace['sidebar_entries'][6]
|
89
|
|
- assert sidebar_entry['slug'] == 'calendar'
|
90
|
|
- assert sidebar_entry['label'] == 'Calendar'
|
91
|
|
- assert sidebar_entry['route'] == "/#/workspaces/1/calendar" # nopep8
|
92
|
|
- assert sidebar_entry['hexcolor'] == "#757575"
|
93
|
|
- assert sidebar_entry['fa_icon'] == "calendar"
|
94
|
|
-
|
95
|
83
|
def test_api__update_workspace__ok_200__nominal_case(self) -> None:
|
96
|
84
|
"""
|
97
|
85
|
Test update workspace
|
|
@@ -118,7 +106,7 @@ class TestWorkspaceEndpoint(FunctionalTest):
|
118
|
106
|
assert workspace['slug'] == 'business'
|
119
|
107
|
assert workspace['label'] == 'Business'
|
120
|
108
|
assert workspace['description'] == 'All importants documents'
|
121
|
|
- assert len(workspace['sidebar_entries']) == 7
|
|
109
|
+ assert len(workspace['sidebar_entries']) == 5
|
122
|
110
|
|
123
|
111
|
# modify workspace
|
124
|
112
|
res = self.testapp.put_json(
|
|
@@ -132,7 +120,7 @@ class TestWorkspaceEndpoint(FunctionalTest):
|
132
|
120
|
assert workspace['slug'] == 'superworkspace'
|
133
|
121
|
assert workspace['label'] == 'superworkspace'
|
134
|
122
|
assert workspace['description'] == 'mysuperdescription'
|
135
|
|
- assert len(workspace['sidebar_entries']) == 7
|
|
123
|
+ assert len(workspace['sidebar_entries']) == 5
|
136
|
124
|
|
137
|
125
|
# after
|
138
|
126
|
res = self.testapp.get(
|
|
@@ -145,7 +133,7 @@ class TestWorkspaceEndpoint(FunctionalTest):
|
145
|
133
|
assert workspace['slug'] == 'superworkspace'
|
146
|
134
|
assert workspace['label'] == 'superworkspace'
|
147
|
135
|
assert workspace['description'] == 'mysuperdescription'
|
148
|
|
- assert len(workspace['sidebar_entries']) == 7
|
|
136
|
+ assert len(workspace['sidebar_entries']) == 5
|
149
|
137
|
|
150
|
138
|
def test_api__update_workspace__err_400__empty_label(self) -> None:
|
151
|
139
|
"""
|
|
@@ -1438,7 +1426,7 @@ class TestWorkspaceContents(FunctionalTest):
|
1438
|
1426
|
params = {
|
1439
|
1427
|
'parent_id': None,
|
1440
|
1428
|
'label': 'GenericCreatedContent',
|
1441
|
|
- 'content_type': 'markdownpage',
|
|
1429
|
+ 'content_type': 'html-document',
|
1442
|
1430
|
}
|
1443
|
1431
|
res = self.testapp.post_json(
|
1444
|
1432
|
'/api/v2/workspaces/1/contents',
|
|
@@ -1449,7 +1437,7 @@ class TestWorkspaceContents(FunctionalTest):
|
1449
|
1437
|
assert res.json_body
|
1450
|
1438
|
assert res.json_body['status'] == 'open'
|
1451
|
1439
|
assert res.json_body['content_id']
|
1452
|
|
- assert res.json_body['content_type'] == 'markdownpage'
|
|
1440
|
+ assert res.json_body['content_type'] == 'html-document'
|
1453
|
1441
|
assert res.json_body['is_archived'] is False
|
1454
|
1442
|
assert res.json_body['is_deleted'] is False
|
1455
|
1443
|
assert res.json_body['workspace_id'] == 1
|
|
@@ -1480,7 +1468,7 @@ class TestWorkspaceContents(FunctionalTest):
|
1480
|
1468
|
)
|
1481
|
1469
|
params = {
|
1482
|
1470
|
'label': 'GenericCreatedContent',
|
1483
|
|
- 'content_type': 'markdownpage',
|
|
1471
|
+ 'content_type': 'html-document',
|
1484
|
1472
|
}
|
1485
|
1473
|
res = self.testapp.post_json(
|
1486
|
1474
|
'/api/v2/workspaces/1/contents',
|
|
@@ -1491,7 +1479,7 @@ class TestWorkspaceContents(FunctionalTest):
|
1491
|
1479
|
assert res.json_body
|
1492
|
1480
|
assert res.json_body['status'] == 'open'
|
1493
|
1481
|
assert res.json_body['content_id']
|
1494
|
|
- assert res.json_body['content_type'] == 'markdownpage'
|
|
1482
|
+ assert res.json_body['content_type'] == 'html-document'
|
1495
|
1483
|
assert res.json_body['is_archived'] is False
|
1496
|
1484
|
assert res.json_body['is_deleted'] is False
|
1497
|
1485
|
assert res.json_body['workspace_id'] == 1
|
|
@@ -1544,7 +1532,7 @@ class TestWorkspaceContents(FunctionalTest):
|
1544
|
1532
|
)
|
1545
|
1533
|
params = {
|
1546
|
1534
|
'label': 'GenericCreatedContent',
|
1547
|
|
- 'content_type': 'markdownpage',
|
|
1535
|
+ 'content_type': 'html-document',
|
1548
|
1536
|
'parent_id': 10,
|
1549
|
1537
|
}
|
1550
|
1538
|
res = self.testapp.post_json(
|
|
@@ -1556,7 +1544,7 @@ class TestWorkspaceContents(FunctionalTest):
|
1556
|
1544
|
assert res.json_body
|
1557
|
1545
|
assert res.json_body['status'] == 'open'
|
1558
|
1546
|
assert res.json_body['content_id']
|
1559
|
|
- assert res.json_body['content_type'] == 'markdownpage'
|
|
1547
|
+ assert res.json_body['content_type'] == 'html-document'
|
1560
|
1548
|
assert res.json_body['is_archived'] is False
|
1561
|
1549
|
assert res.json_body['is_deleted'] is False
|
1562
|
1550
|
assert res.json_body['workspace_id'] == 1
|
|
@@ -1587,7 +1575,7 @@ class TestWorkspaceContents(FunctionalTest):
|
1587
|
1575
|
)
|
1588
|
1576
|
params = {
|
1589
|
1577
|
'label': '',
|
1590
|
|
- 'content_type': 'markdownpage',
|
|
1578
|
+ 'content_type': 'html-document',
|
1591
|
1579
|
}
|
1592
|
1580
|
res = self.testapp.post_json(
|
1593
|
1581
|
'/api/v2/workspaces/1/contents',
|