mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
changed test name and dashboardMock code
This commit is contained in:
parent
1446f54447
commit
38a4a2dc60
@ -7,8 +7,12 @@ describe('DashboardRow', () => {
|
|||||||
let wrapper, panel, getPanelContainer, dashboardMock;
|
let wrapper, panel, getPanelContainer, dashboardMock;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
dashboardMock = { toggleRow: jest.fn() };
|
dashboardMock = {
|
||||||
dashboardMock.meta = { canEdit: true };
|
toggleRow: jest.fn(),
|
||||||
|
meta: {
|
||||||
|
canEdit: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
getPanelContainer = jest.fn().mockReturnValue({
|
getPanelContainer = jest.fn().mockReturnValue({
|
||||||
getDashboard: jest.fn().mockReturnValue(dashboardMock),
|
getDashboard: jest.fn().mockReturnValue(dashboardMock),
|
||||||
@ -35,7 +39,7 @@ describe('DashboardRow', () => {
|
|||||||
expect(wrapper.find('.dashboard-row__actions .pointer')).toHaveLength(2);
|
expect(wrapper.find('.dashboard-row__actions .pointer')).toHaveLength(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have zero actions as viewer', () => {
|
it('should have zero actions when cannot edit', () => {
|
||||||
dashboardMock.meta.canEdit = false;
|
dashboardMock.meta.canEdit = false;
|
||||||
panel = new PanelModel({ collapsed: false });
|
panel = new PanelModel({ collapsed: false });
|
||||||
wrapper = shallow(<DashboardRow panel={panel} getPanelContainer={getPanelContainer} />);
|
wrapper = shallow(<DashboardRow panel={panel} getPanelContainer={getPanelContainer} />);
|
||||||
|
Loading…
Reference in New Issue
Block a user