-
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.
Introduce
Enroll
API endpoint. (#108835)
- Loading branch information
Showing
17 changed files
with
1,650 additions
and
49 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
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,43 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { ConfigSchema } from './config'; | ||
|
||
describe('config schema', () => { | ||
it('generates proper defaults', () => { | ||
expect(ConfigSchema.validate({})).toMatchInlineSnapshot(` | ||
Object { | ||
"connectionCheck": Object { | ||
"interval": "PT5S", | ||
}, | ||
"enabled": false, | ||
} | ||
`); | ||
}); | ||
|
||
describe('#connectionCheck', () => { | ||
it('should properly set required connection check interval', () => { | ||
expect(ConfigSchema.validate({ connectionCheck: { interval: '1s' } })).toMatchInlineSnapshot(` | ||
Object { | ||
"connectionCheck": Object { | ||
"interval": "PT1S", | ||
}, | ||
"enabled": false, | ||
} | ||
`); | ||
}); | ||
|
||
it('should throw error if interactiveSetup.connectionCheck.interval is less than 1 second', () => { | ||
expect(() => | ||
ConfigSchema.validate({ connectionCheck: { interval: 100 } }) | ||
).toThrowErrorMatchingInlineSnapshot( | ||
`"[connectionCheck.interval]: the value must be greater or equal to 1 second."` | ||
); | ||
}); | ||
}); | ||
}); |
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
20 changes: 20 additions & 0 deletions
20
src/plugins/interactive_setup/server/elasticsearch_service.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,20 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { BehaviorSubject } from 'rxjs'; | ||
|
||
import { ElasticsearchConnectionStatus } from '../common'; | ||
|
||
export const elasticsearchServiceMock = { | ||
createSetup: () => ({ | ||
connectionStatus$: new BehaviorSubject<ElasticsearchConnectionStatus>( | ||
ElasticsearchConnectionStatus.Configured | ||
), | ||
enroll: jest.fn(), | ||
}), | ||
}; |
Oops, something went wrong.