文件操作 - AddPanelWidget.test.tsx
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.test.tsx
编辑文件内容
import React from 'react'; import { shallow } from 'enzyme'; import { AddPanelWidgetUnconnected as AddPanelWidget, Props } from './AddPanelWidget'; import { DashboardModel, PanelModel } from '../../state'; const setup = (propOverrides?: object) => { const props: Props = { dashboard: {} as DashboardModel, panel: {} as PanelModel, addPanel: jest.fn() as any, updateLocation: jest.fn() as any, }; Object.assign(props, propOverrides); return shallow(<AddPanelWidget {...props} />); }; describe('Render', () => { it('should render component', () => { const wrapper = setup(); expect(wrapper).toMatchSnapshot(); }); });
修改文件时间
将文件时间修改为当前时间的前一年
删除文件