mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
Fix problem with validation (#225334)
In this fix https://github.com/elastic/kibana/pull/224961 we introduced the possibility of the data property to be null, but it can also be empty. This PR does that.
This commit is contained in:
parent
e78d4faaa5
commit
0a2ae4bfe6
2 changed files with 5 additions and 4 deletions
|
@ -123,8 +123,10 @@ export const UsageMetricsAutoOpsResponseSchema = {
|
|||
schema.object({
|
||||
name: schema.string(),
|
||||
error: schema.nullable(schema.string()),
|
||||
data: schema.nullable(
|
||||
schema.arrayOf(schema.arrayOf(schema.number(), { minSize: 2, maxSize: 2 }))
|
||||
data: schema.maybe(
|
||||
schema.nullable(
|
||||
schema.arrayOf(schema.arrayOf(schema.number(), { minSize: 2, maxSize: 2 }))
|
||||
)
|
||||
),
|
||||
})
|
||||
)
|
||||
|
|
|
@ -190,7 +190,7 @@ describe('registerUsageMetricsRoute', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('when metric type data is null', () => {
|
||||
describe('when metric type data is null or not present', () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(DataUsageService.prototype, 'getMetrics').mockResolvedValue({
|
||||
ingest_rate: [
|
||||
|
@ -220,7 +220,6 @@ describe('registerUsageMetricsRoute', () => {
|
|||
{
|
||||
name: '.ds-2',
|
||||
error: null,
|
||||
data: null,
|
||||
},
|
||||
],
|
||||
search_vcu: [],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue