-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(kms): kms dashboard tests (#13797)
ref: MANAGER-15108 Signed-off-by: Romain Jamet <[email protected]>
- Loading branch information
1 parent
20ed8b3
commit 47b3a75
Showing
37 changed files
with
596 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
packages/manager/apps/key-management-service/src/data/hooks/useKMSServiceInfos.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/manager/apps/key-management-service/src/mocks/credentials/credentials.handler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { PathParams } from 'msw'; | ||
import { Handler } from '../../../../../../../playwright-helpers'; | ||
import { credentialMock } from './credentials.mock'; | ||
|
||
export type GetCredentialsMockParams = { | ||
isCredentialKO?: boolean; | ||
nbCredential?: number; | ||
}; | ||
|
||
const findCredentialByID = (params: PathParams) => | ||
credentialMock.find(({ id }) => id === params.id); | ||
|
||
export const getCredentialsMock = ({ | ||
isCredentialKO, | ||
nbCredential = credentialMock.length, | ||
}: GetCredentialsMockParams): Handler[] => [ | ||
{ | ||
url: '/okms/resource/:okmsId/credential', | ||
response: isCredentialKO | ||
? { | ||
status: 500, | ||
data: { | ||
message: 'credentials error', | ||
}, | ||
} | ||
: (_: unknown, params: PathParams) => findCredentialByID(params), | ||
status: isCredentialKO ? 500 : 200, | ||
api: 'v2', | ||
}, | ||
{ | ||
url: '/okms/resource/:okmsId/credential/:credentialId', | ||
response: isCredentialKO | ||
? { message: 'credential error' } | ||
: credentialMock.slice(0, nbCredential), | ||
status: isCredentialKO ? 500 : 200, | ||
api: 'v2', | ||
}, | ||
]; |
17 changes: 17 additions & 0 deletions
17
packages/manager/apps/key-management-service/src/mocks/credentials/credentials.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
OkmsCredential, | ||
OkmsCredentialStatus, | ||
} from '@/types/okmsCredential.type'; | ||
|
||
export const credentialMock: OkmsCredential[] = [ | ||
{ | ||
createdAt: '2024-10-23T15:24:23Z', | ||
expiredAt: '2024-10-23T15:24:23Z', | ||
fromCSR: true, | ||
id: '3d8a8d6a-e01a-4b0c-a1f1-f0cf67b4e88c', | ||
identityURNs: ['urn:v1:eu:identity:account:ok1-ovh'], | ||
name: 'credential-name', | ||
status: OkmsCredentialStatus.ready, | ||
description: 'credential description', | ||
}, | ||
]; |
Oops, something went wrong.