-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rebuild using Grafana 8.5.3 * Rebuild based on 9.0.0 * Update Provisioning, add tests
- Loading branch information
1 parent
5475e59
commit 17e4f22
Showing
12 changed files
with
3,240 additions
and
5,901 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { shallow, ShallowWrapper } from 'enzyme'; | ||
import React from 'react'; | ||
import { Query } from '../../types'; | ||
import { QueryEditor } from './QueryEditor'; | ||
|
||
/** | ||
* Component | ||
*/ | ||
type ShallowComponent = ShallowWrapper<QueryEditor['props'], QueryEditor['state'], QueryEditor>; | ||
|
||
/** | ||
* Get Query with default values and ability to override | ||
* | ||
* @param overrideQuery | ||
*/ | ||
export const getQuery = (overrideQuery = {}): Query => ({ | ||
refId: 'A', | ||
...overrideQuery, | ||
}); | ||
|
||
/** | ||
* Query Editor | ||
*/ | ||
describe('QueryEditor', () => { | ||
const onRunQuery = jest.fn(); | ||
const onChange = jest.fn(); | ||
|
||
beforeEach(() => { | ||
onRunQuery.mockReset(); | ||
onChange.mockReset(); | ||
}); | ||
|
||
/** | ||
* Component | ||
*/ | ||
describe('Component', () => { | ||
const getComponent = (wrapper: ShallowComponent) => wrapper; | ||
|
||
it('Should apply feedType value and change', () => { | ||
const query = getQuery(); | ||
const wrapper = shallow<QueryEditor>( | ||
<QueryEditor datasource={[] as any} query={query} onRunQuery={onRunQuery} onChange={onChange} /> | ||
); | ||
|
||
const testedComponent = getComponent(wrapper); | ||
expect(testedComponent.exists()); | ||
}); | ||
}); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
Oops, something went wrong.