文件操作 - FolderPicker.test.tsx
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/core/components/Select/FolderPicker.test.tsx
编辑文件内容
import React from 'react'; import { shallow } from 'enzyme'; import { FolderPicker } from './FolderPicker'; jest.mock('@grafana/runtime', () => ({ getBackendSrv: () => ({ search: jest.fn(() => [ { title: 'Dash 1', id: 'A' }, { title: 'Dash 2', id: 'B' }, ]), }), })); jest.mock('app/core/services/context_srv', () => ({ contextSrv: { user: { orgId: 1 }, }, })); describe('FolderPicker', () => { it('should render', () => { const wrapper = shallow(<FolderPicker onChange={jest.fn()} />); expect(wrapper).toMatchSnapshot(); }); });
修改文件时间
将文件时间修改为当前时间的前一年
删除文件