-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution][Endpoint] Isolate Action should only be available…
… to Platinum+ licenses (#102374) * Isolate action should only be available for platinum license * Moved `useLicense` hook mock into `__mocks__`
- Loading branch information
1 parent
8d14128
commit 2507d37
Showing
6 changed files
with
113 additions
and
46 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,21 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { LicenseService } from './license'; | ||
|
||
export const createLicenseServiceMock = (): jest.Mocked<LicenseService> => { | ||
return ({ | ||
start: jest.fn(), | ||
stop: jest.fn(), | ||
getLicenseInformation: jest.fn(), | ||
getLicenseInformation$: jest.fn(), | ||
isAtLeast: jest.fn(), | ||
isGoldPlus: jest.fn().mockReturnValue(true), | ||
isPlatinumPlus: jest.fn().mockReturnValue(true), | ||
isEnterprise: jest.fn().mockReturnValue(true), | ||
} as unknown) as jest.Mocked<LicenseService>; | ||
}; |
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/security_solution/public/common/hooks/__mocks__/use_license.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,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { createLicenseServiceMock } from '../../../../common/license/mocks'; | ||
|
||
export const licenseService = createLicenseServiceMock(); | ||
export const useLicense = () => licenseService; |
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