mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-12 16:44:05 -08:00
React UI: Make test spy attachment more jest-y (#6361)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
parent
d2a3ef2f12
commit
cb92a45bf3
|
@ -177,8 +177,7 @@ describe('ExpressionInput', () => {
|
||||||
it('should blur input on escape', () => {
|
it('should blur input on escape', () => {
|
||||||
const downshift = expressionInput.find(Downshift);
|
const downshift = expressionInput.find(Downshift);
|
||||||
const instance: any = expressionInput.instance();
|
const instance: any = expressionInput.instance();
|
||||||
const spyBlur = jest.fn();
|
const spyBlur = jest.spyOn(instance.exprInputRef.current, 'blur');
|
||||||
instance.exprInputRef.current.blur = spyBlur;
|
|
||||||
const input = downshift.find(Input);
|
const input = downshift.find(Input);
|
||||||
downshift.setState({ isOpen: false });
|
downshift.setState({ isOpen: false });
|
||||||
const event = getKeyEvent('Escape');
|
const event = getKeyEvent('Escape');
|
||||||
|
|
Loading…
Reference in a new issue