mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* mobx: poc in using each store as individual prop on the react containers * prettier test * fix: end the war between prettier vs tslint. * mobx: Move stores into their own folders * mobx: Refactor the AlertRule into its own file and add a helper-file * mobx: Move NavItem out of NavStore and remove lodash dependancy * mobx: Move ResultItem and SearchResultSection models out of the SearchStore * mobx: ServerStatsStore rename .tsx => .ts. And move ServerStat-model to its own file. * mobx: Remove lodash and jquery dependancy from ViewStore * mobx: Remove issue with double question mark
31 lines
753 B
TypeScript
31 lines
753 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 {...store} />);
|
|
|
|
setTimeout(() => {
|
|
expect(page.toJSON()).toMatchSnapshot();
|
|
done();
|
|
});
|
|
});
|
|
});
|