-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into np-move-file-uplo…
…ad-to-np
- Loading branch information
Showing
63 changed files
with
716 additions
and
536 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
36 changes: 36 additions & 0 deletions
36
x-pack/legacy/plugins/ml/public/application/license/__tests__/check_license.js
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,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { xpackInfo } from '../../../../../xpack_main/public/services/xpack_info'; | ||
import { LICENSE_STATUS_VALID } from '../../../../../../common/constants/license_status'; | ||
import { xpackFeatureAvailable } from '../check_license'; | ||
|
||
const initialInfo = { | ||
features: { | ||
watcher: { | ||
status: LICENSE_STATUS_VALID, | ||
}, | ||
}, | ||
}; | ||
|
||
describe('ML - check license', () => { | ||
describe('xpackFeatureAvailable', () => { | ||
beforeEach(() => { | ||
xpackInfo.setAll(initialInfo); | ||
}); | ||
|
||
it('returns true for enabled feature', () => { | ||
const result = xpackFeatureAvailable('watcher'); | ||
expect(result).to.be(true); | ||
}); | ||
|
||
it('returns false for disabled feature', () => { | ||
const result = xpackFeatureAvailable('noSuchFeature'); | ||
expect(result).to.be(false); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.