文件操作 - LokiExploreExtraField.test.tsx
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/plugins/datasource/loki/components/LokiExploreExtraField.test.tsx
编辑文件内容
import React from 'react'; import { shallow } from 'enzyme'; import { LokiExploreExtraField, LokiExploreExtraFieldProps } from './LokiExploreExtraField'; const setup = (propOverrides?: LokiExploreExtraFieldProps) => { const label = 'Loki Explore Extra Field'; const value = '123'; const type = 'number'; const min = 0; const onChangeFunc = jest.fn(); const onKeyDownFunc = jest.fn(); const props: any = { label, value, type, min, onChangeFunc, onKeyDownFunc, }; Object.assign(props, propOverrides); return shallow(<LokiExploreExtraField {...props} />); }; describe('LokiExploreExtraField', () => { it('should render component', () => { const wrapper = setup(); expect(wrapper).toMatchSnapshot(); }); });
修改文件时间
将文件时间修改为当前时间的前一年
删除文件