Skip to content

Commit fd202eb

Browse files
committed
update unit tests for the user data sync service
1 parent be03961 commit fd202eb

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

src/vs/platform/userDataSync/test/common/userDataSyncService.test.ts

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ suite('UserDataSyncService', () => {
4747
{ type: 'POST', url: `${target.url}/v1/resource/globalState`, headers: { 'If-Match': '0' } },
4848
// Extensions
4949
{ type: 'GET', url: `${target.url}/v1/resource/extensions/latest`, headers: {} },
50-
// Profiles
51-
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
5250
// Prompts
5351
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: {} },
5452
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '0' } },
53+
// Profiles
54+
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
5555
]);
5656

5757
});
@@ -84,11 +84,11 @@ suite('UserDataSyncService', () => {
8484
{ type: 'POST', url: `${target.url}/v1/resource/globalState`, headers: { 'If-Match': '0' } },
8585
// Extensions
8686
{ type: 'GET', url: `${target.url}/v1/resource/extensions/latest`, headers: {} },
87-
// Profiles
88-
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
8987
// Prompts
9088
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: {} },
9189
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '0' } },
90+
// Profiles
91+
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
9292
]);
9393
});
9494

@@ -117,12 +117,11 @@ suite('UserDataSyncService', () => {
117117
{ type: 'GET', url: `${target.url}/v1/resource/globalState/latest`, headers: {} },
118118
// Extensions
119119
{ type: 'GET', url: `${target.url}/v1/resource/extensions/latest`, headers: {} },
120-
// Profiles
121-
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
122120
// Prompts
123121
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: {} },
122+
// Profiles
123+
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
124124
]);
125-
126125
});
127126

128127
test('test first time sync from the client with no changes - merge', async () => {
@@ -150,10 +149,9 @@ suite('UserDataSyncService', () => {
150149
{ type: 'GET', url: `${target.url}/v1/resource/tasks/latest`, headers: {} },
151150
{ type: 'GET', url: `${target.url}/v1/resource/globalState/latest`, headers: {} },
152151
{ type: 'GET', url: `${target.url}/v1/resource/extensions/latest`, headers: {} },
153-
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
154152
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: {} },
153+
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
155154
]);
156-
157155
});
158156

159157
test('test first time sync from the client with changes - merge', async () => {
@@ -193,9 +191,9 @@ suite('UserDataSyncService', () => {
193191
{ type: 'GET', url: `${target.url}/v1/resource/tasks/latest`, headers: {} },
194192
{ type: 'GET', url: `${target.url}/v1/resource/globalState/latest`, headers: {} },
195193
{ type: 'GET', url: `${target.url}/v1/resource/extensions/latest`, headers: {} },
196-
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
197194
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: {} },
198195
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '1' } },
196+
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
199197
]);
200198

201199
});
@@ -238,11 +236,11 @@ suite('UserDataSyncService', () => {
238236
{ type: 'GET', url: `${target.url}/v1/resource/tasks/latest`, headers: {} },
239237
{ type: 'GET', url: `${target.url}/v1/resource/globalState/latest`, headers: {} },
240238
{ type: 'GET', url: `${target.url}/v1/resource/extensions/latest`, headers: {} },
239+
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: {} },
240+
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '1' } },
241241
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
242242
{ type: 'POST', url: `${target.url}/v1/collection`, headers: {} },
243243
{ type: 'POST', url: `${target.url}/v1/resource/profiles`, headers: { 'If-Match': '0' } },
244-
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: {} },
245-
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '1' } },
246244
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/settings/latest`, headers: {} },
247245
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/keybindings/latest`, headers: {} },
248246
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/snippets/latest`, headers: {} },
@@ -347,11 +345,11 @@ suite('UserDataSyncService', () => {
347345
{ type: 'POST', url: `${target.url}/v1/resource/snippets`, headers: { 'If-Match': '1' } },
348346
// Global state
349347
{ type: 'POST', url: `${target.url}/v1/resource/globalState`, headers: { 'If-Match': '1' } },
348+
// Prompts
349+
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '1' } },
350350
// Profiles
351351
{ type: 'POST', url: `${target.url}/v1/collection`, headers: {} },
352352
{ type: 'POST', url: `${target.url}/v1/resource/profiles`, headers: { 'If-Match': '0' } },
353-
// Prompts
354-
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '1' } },
355353
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/settings/latest`, headers: {} },
356354
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/keybindings/latest`, headers: {} },
357355
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/snippets/latest`, headers: {} },
@@ -486,10 +484,10 @@ suite('UserDataSyncService', () => {
486484
{ type: 'GET', url: `${target.url}/v1/resource/snippets/latest`, headers: { 'If-None-Match': '1' } },
487485
// Global state
488486
{ type: 'GET', url: `${target.url}/v1/resource/globalState/latest`, headers: { 'If-None-Match': '1' } },
489-
// Profiles
490-
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: { 'If-None-Match': '0' } },
491487
// Prompts
492488
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: { 'If-None-Match': '1' } },
489+
// Profiles
490+
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: { 'If-None-Match': '0' } },
493491
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/settings/latest`, headers: {} },
494492
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/keybindings/latest`, headers: {} },
495493
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/snippets/latest`, headers: {} },
@@ -558,11 +556,11 @@ suite('UserDataSyncService', () => {
558556
{ type: 'POST', url: `${target.url}/v1/resource/globalState`, headers: { 'If-Match': '0' } },
559557
// Extensions
560558
{ type: 'GET', url: `${target.url}/v1/resource/extensions/latest`, headers: {} },
561-
// Profiles
562-
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
563559
// Prompts
564560
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: {} },
565561
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '0' } },
562+
// Profiles
563+
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: {} },
566564
]);
567565

568566
});
@@ -749,11 +747,11 @@ suite('UserDataSyncService', () => {
749747
{ type: 'POST', url: `${target.url}/v1/resource/snippets`, headers: { 'If-Match': '1' } },
750748
// Global state
751749
{ type: 'POST', url: `${target.url}/v1/resource/globalState`, headers: { 'If-Match': '1' } },
750+
// Prompts
751+
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '1' } },
752752
// Profiles
753753
{ type: 'POST', url: `${target.url}/v1/collection`, headers: {} },
754754
{ type: 'POST', url: `${target.url}/v1/resource/profiles`, headers: { 'If-Match': '0' } },
755-
// Prompts
756-
{ type: 'POST', url: `${target.url}/v1/resource/prompts`, headers: { 'If-Match': '1' } },
757755
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/keybindings/latest`, headers: {} },
758756
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/snippets/latest`, headers: {} },
759757
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/tasks/latest`, headers: {} },
@@ -804,10 +802,10 @@ suite('UserDataSyncService', () => {
804802
{ type: 'GET', url: `${target.url}/v1/resource/snippets/latest`, headers: { 'If-None-Match': '1' } },
805803
// Global state
806804
{ type: 'GET', url: `${target.url}/v1/resource/globalState/latest`, headers: { 'If-None-Match': '1' } },
807-
// Profiles
808-
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: { 'If-None-Match': '0' } },
809805
// Prompts
810806
{ type: 'GET', url: `${target.url}/v1/resource/prompts/latest`, headers: { 'If-None-Match': '1' } },
807+
// Profiles
808+
{ type: 'GET', url: `${target.url}/v1/resource/profiles/latest`, headers: { 'If-None-Match': '0' } },
811809
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/settings/latest`, headers: {} },
812810
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/snippets/latest`, headers: {} },
813811
{ type: 'GET', url: `${target.url}/v1/collection/1/resource/tasks/latest`, headers: {} },
@@ -817,5 +815,4 @@ suite('UserDataSyncService', () => {
817815
]);
818816

819817
});
820-
821818
});

0 commit comments

Comments
 (0)