-
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.
Merge branch 'main' into system_actions_refs
- Loading branch information
Showing
5 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...e_clusters/__jest__/client_integration/add/__snapshots__/remote_clusters_add.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
29 changes: 29 additions & 0 deletions
29
.../remote_clusters/public/application/sections/components/remote_cluster_form/utils.test.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,29 @@ | ||
/* | ||
* 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 { removeNullProperties } from './request_flyout'; | ||
|
||
describe('Remote cluster form Utils', () => { | ||
test('can remote deeply nested null properties from object', () => { | ||
const obj = { | ||
a: 'a', | ||
b: { | ||
c: 'c', | ||
d: null, | ||
}, | ||
}; | ||
|
||
expect(removeNullProperties(obj)).toStrictEqual({ | ||
...obj, | ||
b: { | ||
c: 'c', | ||
}, | ||
}); | ||
|
||
expect(removeNullProperties({ a: 'a', b: null })).toStrictEqual({ a: 'a' }); | ||
}); | ||
}); |