Browse Source

changed test name and dashboardMock code

Patrick O'Carroll 7 years ago
parent
commit
38a4a2dc60
1 changed files with 7 additions and 3 deletions
  1. 7 3
      public/app/features/dashboard/specs/DashboardRow.jest.tsx

+ 7 - 3
public/app/features/dashboard/specs/DashboardRow.jest.tsx

@@ -7,8 +7,12 @@ describe('DashboardRow', () => {
   let wrapper, panel, getPanelContainer, dashboardMock;
 
   beforeEach(() => {
-    dashboardMock = { toggleRow: jest.fn() };
-    dashboardMock.meta = { canEdit: true };
+    dashboardMock = {
+      toggleRow: jest.fn(),
+      meta: {
+        canEdit: true,
+      },
+    };
 
     getPanelContainer = jest.fn().mockReturnValue({
       getDashboard: jest.fn().mockReturnValue(dashboardMock),
@@ -35,7 +39,7 @@ describe('DashboardRow', () => {
     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;
     panel = new PanelModel({ collapsed: false });
     wrapper = shallow(<DashboardRow panel={panel} getPanelContainer={getPanelContainer} />);