mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
31 lines
777 B
TypeScript
31 lines
777 B
TypeScript
import React from 'react';
|
|
import renderer from 'react-test-renderer';
|
|
import { ServerStats } from './ServerStats';
|
|
import { RootStore } from 'app/stores/RootStore/RootStore';
|
|
import { backendSrv, createNavTree } from 'test/mocks/common';
|
|
|
|
describe('ServerStats', () => {
|
|
it('Should render table with stats', done => {
|
|
backendSrv.get.mockReturnValue(
|
|
Promise.resolve({
|
|
dashboards: 10,
|
|
})
|
|
);
|
|
|
|
const store = RootStore.create(
|
|
{},
|
|
{
|
|
backendSrv: backendSrv,
|
|
navTree: createNavTree('cfg', 'admin', 'server-stats'),
|
|
}
|
|
);
|
|
|
|
const page = renderer.create(<ServerStats backendSrv={backendSrv} {...store} />);
|
|
|
|
setTimeout(() => {
|
|
expect(page.toJSON()).toMatchSnapshot();
|
|
done();
|
|
});
|
|
});
|
|
});
|