Skip to content

Commit 969f057

Browse files
committed
fix tests
1 parent f9fe38c commit 969f057

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

x-pack/solutions/observability/plugins/slo/server/domain/services/compute_health.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('computeHealth', () => {
3030
mockScopedClusterClient.asSecondaryAuthUser.transform.getTransformStats.mockResolvedValue({
3131
transforms: [],
3232
count: 0,
33-
} as TransformGetTransformStatsResponse);
33+
});
3434

3535
const results = await computeHealth(items, { scopedClusterClient: mockScopedClusterClient });
3636

x-pack/solutions/observability/plugins/slo/server/services/find_slo_definitions.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ describe('FindSLODefinitions with Health validation', () => {
6161
page: 1,
6262
perPage: 100,
6363
});
64+
mockScopedClusterClient.asSecondaryAuthUser.transform.getTransformStats.mockResolvedValue({
65+
transforms: [],
66+
count: 0,
67+
});
6468

6569
await findSLODefinitions.execute({
6670
includeHealth: true,

x-pack/solutions/observability/plugins/slo/server/services/get_slo_health.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ describe('GetSLOHealth', () => {
3434
it('filters out items without definition', async () => {
3535
const slo = createSLO();
3636
mockRepository.findAllByIds.mockResolvedValueOnce([slo]);
37+
mockScopedClusterClient.asSecondaryAuthUser.transform.getTransformStats.mockResolvedValue({
38+
transforms: [],
39+
count: 0,
40+
});
3741

3842
const result = await getSLOHealth.execute({
3943
list: [
@@ -71,6 +75,10 @@ describe('GetSLOHealth', () => {
7175
const slo1 = createSLO({ id: 'slo_1' });
7276
const slo2 = createSLO({ id: 'slo_2', enabled: false });
7377
mockRepository.findAllByIds.mockResolvedValueOnce([slo1, slo2]);
78+
mockScopedClusterClient.asSecondaryAuthUser.transform.getTransformStats.mockResolvedValue({
79+
transforms: [],
80+
count: 0,
81+
});
7482

7583
await getSLOHealth.execute({
7684
list: [

0 commit comments

Comments
 (0)