Skip to content

Commit 9c61b3d

Browse files
committed
refactor: fixing test
1 parent ca25f5c commit 9c61b3d

File tree

2 files changed

+37
-8
lines changed

2 files changed

+37
-8
lines changed

projects/observability/src/pages/apis/api-detail/api-detail-breadcrumb.resolver.test.ts

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,40 @@ describe('Api detail breadcrumb resolver', () => {
8484
runFakeRxjs(({ expectObservable }) => {
8585
expectObservable(breadcrumb$).toBe('(abc|)', {
8686
a: {
87+
[entityIdKey]: 'test-id',
88+
[entityTypeKey]: ObservabilityEntityType.Api,
8789
label: 'test service',
8890
icon: ObservabilityIconType.Service,
89-
url: ['services', 'service', 'test-service-id']
91+
url: ['services', 'service', 'test-service-id'],
92+
name: 'test api',
93+
parentId: 'test-service-id',
94+
parentName: 'test service',
95+
serviceName: 'test service',
96+
serviceId: 'test-service-id'
9097
},
9198
b: {
99+
[entityIdKey]: 'test-id',
100+
[entityTypeKey]: ObservabilityEntityType.Api,
92101
label: 'Endpoints',
93102
icon: ObservabilityIconType.Api,
94-
url: ['services', 'service', 'test-service-id', 'endpoints']
103+
url: ['services', 'service', 'test-service-id', 'endpoints'],
104+
name: 'test api',
105+
parentId: 'test-service-id',
106+
parentName: 'test service',
107+
serviceName: 'test service',
108+
serviceId: 'test-service-id'
95109
},
96110
c: {
111+
[entityIdKey]: 'test-id',
112+
[entityTypeKey]: ObservabilityEntityType.Api,
97113
label: 'test api',
98114
icon: ObservabilityIconType.Api,
99-
url: ['api', 'test-id']
115+
url: ['api', 'test-id'],
116+
name: 'test api',
117+
parentId: 'test-service-id',
118+
parentName: 'test service',
119+
serviceName: 'test service',
120+
serviceId: 'test-service-id'
100121
}
101122
});
102123
});
@@ -109,7 +130,7 @@ describe('Api detail breadcrumb resolver', () => {
109130
entityType: ObservabilityEntityType.Api,
110131
id: 'test-id'
111132
}),
112-
{ cacheability: GraphQlRequestCacheability.NotCacheable }
133+
{ cacheability: GraphQlRequestCacheability.Cacheable }
113134
);
114135
}));
115136

@@ -123,9 +144,14 @@ describe('Api detail breadcrumb resolver', () => {
123144
runFakeRxjs(({ expectObservable }) => {
124145
expectObservable(breadcrumb$).toBe('(y|)', {
125146
y: {
147+
[entityIdKey]: 'test-id',
148+
[entityTypeKey]: ObservabilityEntityType.Api,
126149
label: 'test api',
127150
icon: ObservabilityIconType.Api,
128-
url: ['api', 'test-id']
151+
url: ['api', 'test-id'],
152+
name: 'test api',
153+
serviceName: 'test service',
154+
serviceId: 'test-service-id'
129155
}
130156
});
131157
});
@@ -138,7 +164,7 @@ describe('Api detail breadcrumb resolver', () => {
138164
entityType: ObservabilityEntityType.Api,
139165
id: 'test-id'
140166
}),
141-
{ cacheability: GraphQlRequestCacheability.NotCacheable }
167+
{ cacheability: GraphQlRequestCacheability.Cacheable }
142168
);
143169
}));
144170
});

projects/observability/src/pages/apis/service-detail/service-detail-breadcrumb.resolver.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ describe('Service detail breadcrumb resolver', () => {
5656
runFakeRxjs(({ expectObservable }) => {
5757
expectObservable(breadcrumb$).toBe('(x|)', {
5858
x: {
59+
[entityTypeKey]: ObservabilityEntityType.Service,
60+
[entityIdKey]: 'test-id',
5961
label: 'test service',
60-
icon: ObservabilityIconType.Service
62+
icon: ObservabilityIconType.Service,
63+
name: 'test service'
6164
}
6265
});
6366
});
@@ -70,7 +73,7 @@ describe('Service detail breadcrumb resolver', () => {
7073
entityType: ObservabilityEntityType.Service,
7174
id: 'test-id'
7275
}),
73-
{ cacheability: GraphQlRequestCacheability.NotCacheable }
76+
{ cacheability: GraphQlRequestCacheability.Cacheable }
7477
);
7578
}));
7679
});

0 commit comments

Comments
 (0)