Browse Source

provisioning: fix tests for save provisioned dashboard modal

Marcus Efraimsson 7 years ago
parent
commit
f619dd579e

+ 6 - 4
public/app/features/dashboard/specs/save_provisioned_modal.jest.ts

@@ -1,5 +1,4 @@
 import { SaveProvisionedDashboardModalCtrl } from '../save_provisioned_modal';
-import { describe, it, expect } from 'test/lib/common';
 
 describe('SaveProvisionedDashboardModalCtrl', () => {
   var json = {
@@ -21,8 +20,11 @@ describe('SaveProvisionedDashboardModalCtrl', () => {
 
   var ctrl = new SaveProvisionedDashboardModalCtrl(mockDashboardSrv);
 
-  it('verify that the id have been removed', () => {
-    var copy = ctrl.getJsonForClipboard();
-    expect(copy).toBe(`{"title":"name"}`);
+  it('should remove id from dashboard model', () => {
+    expect(ctrl.dash.id).toBeUndefined();
+  });
+
+  it('should remove id from dashboard model in clipboard json', () => {
+    expect(ctrl.getJsonForClipboard()).toBe(JSON.stringify({ title: 'name' }, null, 2));
   });
 });