Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme committed Apr 23, 2024
1 parent 6760c5f commit deb1808
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,20 @@ describe('GetSLOHealth', () => {
});

expect(result).toMatchInlineSnapshot(`
Array [
Object {
"health": Object {
"overall": "unhealthy",
"rollup": "unhealthy",
"summary": "unhealthy",
},
"sloId": "95ffb9af-1384-4d24-8e3f-345a03d7a439",
"sloInstanceId": "*",
"state": "no_data",
Array [
Object {
"health": Object {
"overall": "unhealthy",
"rollup": "unhealthy",
"summary": "unhealthy",
},
]
`);
"sloId": "95ffb9af-1384-4d24-8e3f-345a03d7a439",
"sloInstanceId": "*",
"sloRevision": 1,
"state": "no_data",
},
]
`);
});

it('handles inexistant sloId', async () => {
Expand Down Expand Up @@ -139,19 +140,20 @@ describe('GetSLOHealth', () => {
});

expect(result).toMatchInlineSnapshot(`
Array [
Object {
"health": Object {
"overall": "healthy",
"rollup": "healthy",
"summary": "healthy",
Array [
Object {
"health": Object {
"overall": "healthy",
"rollup": "healthy",
"summary": "healthy",
},
"sloId": "95ffb9af-1384-4d24-8e3f-345a03d7a439",
"sloInstanceId": "*",
"sloRevision": 1,
"state": "no_data",
},
"sloId": "95ffb9af-1384-4d24-8e3f-345a03d7a439",
"sloInstanceId": "*",
"state": "no_data",
},
]
`);
]
`);
});

it('returns unhealthy whenever one of the transform is unhealthy', async () => {
Expand Down Expand Up @@ -189,19 +191,20 @@ describe('GetSLOHealth', () => {
});

expect(result).toMatchInlineSnapshot(`
Array [
Object {
"health": Object {
"overall": "unhealthy",
"rollup": "unhealthy",
"summary": "healthy",
Array [
Object {
"health": Object {
"overall": "unhealthy",
"rollup": "unhealthy",
"summary": "healthy",
},
"sloId": "95ffb9af-1384-4d24-8e3f-345a03d7a439",
"sloInstanceId": "*",
"sloRevision": 1,
"state": "no_data",
},
"sloId": "95ffb9af-1384-4d24-8e3f-345a03d7a439",
"sloInstanceId": "*",
"state": "no_data",
},
]
`);
]
`);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Summary Search Client', () => {
esClientMock,
soClientMock,
loggerMock.create(),
'some-space'
'default'
);
});

Expand Down Expand Up @@ -102,10 +102,10 @@ describe('Summary Search Client', () => {
},
max_score: 1,
hits: [
aHitFromSummaryIndex(aSummaryDocument(SLO_ID1)),
aHitFromSummaryIndex(aSummaryDocument(SLO_ID2)),
aHitFromSummaryIndex(aSummaryDocument(SLO_ID3)),
aHitFromSummaryIndex(aSummaryDocument(SLO_ID5)), // no related temp doc
aHitFromSummaryIndex(aSummaryDocument(SLO_ID1, { isTempDoc: false })),
aHitFromSummaryIndex(aSummaryDocument(SLO_ID2, { isTempDoc: false })),
aHitFromSummaryIndex(aSummaryDocument(SLO_ID3, { isTempDoc: false })),
aHitFromSummaryIndex(aSummaryDocument(SLO_ID5, { isTempDoc: false })), // no related temp doc
aHitFromTempSummaryIndex(aSummaryDocument(SLO_ID1, { isTempDoc: true })), // removed as dup
aHitFromTempSummaryIndex(aSummaryDocument(SLO_ID2, { isTempDoc: true })), // removed as dup
aHitFromTempSummaryIndex(aSummaryDocument(SLO_ID3, { isTempDoc: true })), // removed as dup
Expand Down

0 comments on commit deb1808

Please sign in to comment.