Skip to content

Commit

Permalink
Update fake responses in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriLojda committed Aug 13, 2024
1 parent 75b16d9 commit a3d4384
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 78 deletions.
1 change: 1 addition & 0 deletions test/browser/content-items/add-content-items.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ describe('Add content item', () => {
expect(response.data.name).toEqual(addContentItemResponseJson.name);
expect(response.data.type).toEqual(addContentItemResponseJson.type);
expect(response.data.collection.id).toEqual(addContentItemResponseJson.collection.id);
expect(response.data.spaces).toEqual(addContentItemResponseJson.spaces);
});
});
1 change: 1 addition & 0 deletions test/browser/content-items/list-content-items.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ describe('List content items', () => {
expect(m.type.id).toBeDefined();
expect(m.lastModified).toEqual(jasmine.any(Date));
expect(m.collection.id).toBeDefined();
expect(m.spaces).toBeDefined();
});
});
});
1 change: 1 addition & 0 deletions test/browser/content-items/update-content-items.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ describe('Update content item', () => {
expect(response.data.name).toEqual(updateContentItemResponseJson.name);
expect(response.data.type).toEqual(updateContentItemResponseJson.type);
expect(response.data.collection.id).toEqual(updateContentItemResponseJson.collection.id);
expect(response.data.spaces).toEqual(updateContentItemResponseJson.spaces);
});
});
1 change: 1 addition & 0 deletions test/browser/content-items/upsert-content-items.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ describe('Upsert content item', () => {
expect(response.data.name).toEqual(upsertContentItemResponseJson.name);
expect(response.data.type).toEqual(upsertContentItemResponseJson.type);
expect(response.data.collection.id).toEqual(upsertContentItemResponseJson.collection.id);
expect(response.data.spaces).toEqual(upsertContentItemResponseJson.spaces);
});
});
1 change: 1 addition & 0 deletions test/browser/content-items/view-content-item.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ describe('View content item', () => {
expect(response.data.type).toEqual(viewContentItemJson.type);
expect(response.data.collection).toEqual(jasmine.any(SharedModels.ReferenceObject));
expect(response.data.collection.id).toEqual(viewContentItemJson.collection.id);
expect(response.data.spaces).toEqual(viewContentItemJson.spaces);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"type": {
"id": "b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89"
},
"spaces": [],
"external_id": "59713",
"last_modified": "2017-04-04T13:45:30.7692802Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,44 +1,58 @@
{
"items": [
"items": [
{
"id": "a815faa5-009e-489b-b8bb-a7f3dda0e047",
"name": "Office in Australia",
"codename": "office_in_australia",
"type": {
"id": "e097306b-3893-4a42-9973-2525fad14d66"
},
"spaces": [
{
"id": "a815faa5-009e-489b-b8bb-a7f3dda0e047",
"name": "Office in Australia",
"codename": "office_in_australia",
"type": {
"id": "e097306b-3893-4a42-9973-2525fad14d66"
},
"last_modified": "2016-10-20T10:50:51.0110853Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
},
"id": "69f5c2f3-7efd-46cb-9adc-4fd0200f81cc"
}
],
"last_modified": "2016-10-20T10:50:51.0110853Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
},
{
"id": "69f5c2f3-7efd-46cb-9adc-4fd0200f81cc",
"name": "Melbourne",
"codename": "melbourne",
"type": {
"id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2"
},
"spaces": [],
"last_modified": "2016-09-01T08:36:30.1564913Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
},
{
"id": "e844a6aa-4dc4-464f-8ae9-f9f66cc6ab61",
"name": "Amsterdam",
"codename": "amsterdam",
"type": {
"id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2"
},
"spaces": [
{
"id": "69f5c2f3-7efd-46cb-9adc-4fd0200f81cc",
"name": "Melbourne",
"codename": "melbourne",
"type": {
"id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2"
},
"last_modified": "2016-09-01T08:36:30.1564913Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
"id": "6fda2bfd-a749-480a-a96d-09d2a78ff80d"
},
{
"id": "e844a6aa-4dc4-464f-8ae9-f9f66cc6ab61",
"name": "Amsterdam",
"codename": "amsterdam",
"type": {
"id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2"
},
"last_modified": "2016-09-01T08:25:04.4666023Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
"id": "11d774f0-f364-462d-be61-437ece2686c7"
}
],
"pagination": {
"continuation_token": "MTAw",
"next_page": "https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items?continuationToken=MTAw"
],
"last_modified": "2016-09-01T08:25:04.4666023Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
}
}
],
"pagination": {
"continuation_token": "MTAw",
"next_page": "https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items?continuationToken=MTAw"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"type": {
"id": "b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89"
},
"spaces": [],
"external_id": "59713",
"last_modified": "2017-04-04T13:45:30.7692802Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"type": {
"id": "b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89"
},
"spaces": [],
"external_id": "59713",
"last_modified": "2017-04-04T13:45:30.7692802Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
},
"external_id": "59713",
"last_modified": "2017-04-04T13:45:30.7692802Z",
"spaces": [
{
"id": "f4b3fc05-e988-4dae-9ac1-a94aba"
}
],
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
}
}
88 changes: 51 additions & 37 deletions test/browser/fake-responses/list-all-query/fake-list-all-query.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,58 @@
{
"items": [
"items": [
{
"id": "a815faa5-009e-489b-b8bb-a7f3dda0e047",
"name": "Office in Australia",
"codename": "office_in_australia",
"type": {
"id": "e097306b-3893-4a42-9973-2525fad14d66"
},
"spaces": [
{
"id": "a815faa5-009e-489b-b8bb-a7f3dda0e047",
"name": "Office in Australia",
"codename": "office_in_australia",
"type": {
"id": "e097306b-3893-4a42-9973-2525fad14d66"
},
"last_modified": "2016-10-20T10:50:51.0110853Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
},
"id": "d3b1e3c1-3d9f-4f5e-8b22-1f2e3e0d3c5d"
}
],
"last_modified": "2016-10-20T10:50:51.0110853Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
},
{
"id": "69f5c2f3-7efd-46cb-9adc-4fd0200f81cc",
"name": "Melbourne",
"codename": "melbourne",
"type": {
"id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2"
},
"spaces": [],
"last_modified": "2016-09-01T08:36:30.1564913Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
},
{
"id": "e844a6aa-4dc4-464f-8ae9-f9f66cc6ab61",
"name": "Amsterdam",
"codename": "amsterdam",
"type": {
"id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2"
},
"spaces": [
{
"id": "69f5c2f3-7efd-46cb-9adc-4fd0200f81cc",
"name": "Melbourne",
"codename": "melbourne",
"type": {
"id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2"
},
"last_modified": "2016-09-01T08:36:30.1564913Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
"id": "d3af24fe-4874-4614-b658-c4f9eaafe73a"
},
{
"id": "e844a6aa-4dc4-464f-8ae9-f9f66cc6ab61",
"name": "Amsterdam",
"codename": "amsterdam",
"type": {
"id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2"
},
"last_modified": "2016-09-01T08:25:04.4666023Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
"id": "b6ed4986-1345-4f61-b086-a122f88f344c"
}
],
"pagination": {
"continuation_token": null,
"next_page": "https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items?continuationToken=MTAw"
],
"last_modified": "2016-09-01T08:25:04.4666023Z",
"collection": {
"id": "c4224458-f24c-4f8e-a719-7faaadbc6e88"
}
}
}
],
"pagination": {
"continuation_token": null,
"next_page": "https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items?continuationToken=MTAw"
}
}

0 comments on commit a3d4384

Please sign in to comment.