-
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.
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
...est_manager/sections/agent_config/create_datasource_page/services/is_advanced_var.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,62 @@ | ||
/* | ||
* 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 { isAdvancedVar } from './is_advanced_var'; | ||
|
||
describe('Ingest Manager - isAdvancedVar', () => { | ||
it('returns true for vars that should be show under advanced options', () => { | ||
expect( | ||
isAdvancedVar({ | ||
name: 'mock_var', | ||
type: 'text', | ||
required: true, | ||
default: 'default string', | ||
}) | ||
).toBe(true); | ||
|
||
expect( | ||
isAdvancedVar({ | ||
name: 'mock_var', | ||
type: 'text', | ||
default: 'default string', | ||
}) | ||
).toBe(true); | ||
|
||
expect( | ||
isAdvancedVar({ | ||
name: 'mock_var', | ||
type: 'text', | ||
}) | ||
).toBe(true); | ||
}); | ||
|
||
it('returns false for vars that should be show by default', () => { | ||
expect( | ||
isAdvancedVar({ | ||
name: 'mock_var', | ||
type: 'text', | ||
required: true, | ||
default: 'default string', | ||
show_user: true, | ||
}) | ||
).toBe(false); | ||
|
||
expect( | ||
isAdvancedVar({ | ||
name: 'mock_var', | ||
type: 'text', | ||
required: true, | ||
}) | ||
).toBe(false); | ||
|
||
expect( | ||
isAdvancedVar({ | ||
name: 'mock_var', | ||
type: 'text', | ||
show_user: true, | ||
}) | ||
).toBe(false); | ||
}); | ||
}); |