Skip to content

Commit 31f923f

Browse files
committed
Fix failing unit test
- (cf) ensure the space exists in the mock store so when denoramlize occurrs it can find it - (store) ensure the entity contains an id property matching that of the schema (guid --> id)
1 parent d397298 commit 31f923f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/frontend/packages/cloud-foundry/src/entity-relations/entity-relations-validate.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ describe('Entity Relations - validate -', () => {
282282

283283
advancedSetup(store => {
284284
store.requestData[orgEntityKey][orgGuid].entity.spaces = [space];
285+
// Ensure the space exists in the store so when we denormalize it can correctly find it
286+
store.requestData[spaceEntityKey][space.metadata.guid] = space;
285287
return store;
286288
});
287289

src/frontend/packages/store/src/entity-service.spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ const catalogEndpointEntity = new StratosBaseCatalogEntity({
5858
const catalogEntity = new StratosBaseCatalogEntity({
5959
endpoint: catalogEndpointEntity.definition as IStratosEndpointDefinition,
6060
type: entityType,
61-
schema: new EntitySchema(
62-
entityType,
63-
endpointType
64-
),
61+
schema: entitySchema,
6562
label: 'Entity',
6663
labelPlural: 'Entities',
6764

@@ -81,7 +78,7 @@ function getAllTheThings(store: Store<GeneralAppState>, guid: string, schemaKey:
8178
const entities = {
8279
[entitySchema.key]: {
8380
[guid]: {
84-
guid,
81+
id: guid,
8582
test: 123
8683
}
8784
}

0 commit comments

Comments
 (0)