文件操作 - TableContainer.test.tsx
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/features/explore/TableContainer.test.tsx
编辑文件内容
import React from 'react'; import { render, shallow } from 'enzyme'; import { TableContainer } from './TableContainer'; import { DataFrame } from '@grafana/data'; import { toggleTable } from './state/actions'; import { ExploreId } from 'app/types/explore'; describe('TableContainer', () => { it('should render component', () => { const props = { exploreId: ExploreId.left as ExploreId, loading: false, width: 800, onCellFilterAdded: jest.fn(), showingTable: true, tableResult: {} as DataFrame, toggleTable: {} as typeof toggleTable, splitOpen: (() => {}) as any, range: {} as any, }; const wrapper = shallow(<TableContainer {...props} />); expect(wrapper).toMatchSnapshot(); }); it('should render 0 series returned on no items', () => { const props = { exploreId: ExploreId.left as ExploreId, loading: false, width: 800, onCellFilterAdded: jest.fn(), showingTable: true, tableResult: { name: 'TableResultName', fields: [], length: 0, } as DataFrame, toggleTable: {} as typeof toggleTable, splitOpen: (() => {}) as any, range: {} as any, }; const wrapper = render(<TableContainer {...props} />); expect(wrapper.find('0 series returned')).toBeTruthy(); }); });
修改文件时间
将文件时间修改为当前时间的前一年
删除文件