williaster commented on a change in pull request #5398: Re-add dashboard short 
links
URL: 
https://github.com/apache/incubator-superset/pull/5398#discussion_r207461963
 
 

 ##########
 File path: 
superset/assets/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx
 ##########
 @@ -0,0 +1,84 @@
+import React from 'react';
+import { describe, it } from 'mocha';
+import { expect } from 'chai';
+import { shallow } from 'enzyme';
+import { DropdownButton, MenuItem } from 'react-bootstrap';
+import RefreshIntervalModal from 
'../../../../src/dashboard/components/RefreshIntervalModal';
+import URLShortLinkModal from '../../../../src/components/URLShortLinkModal';
+import HeaderActionsDropdown from 
'../../../../src/dashboard/components/HeaderActionsDropdown';
+import SaveModal from '../../../../src/dashboard/components/SaveModal';
+import CssEditor from '../../../../src/dashboard/components/CssEditor';
+
+describe('HeaderActionsDropdown', () => {
+  const props = {
+    addSuccessToast: () => {},
+    addDangerToast: () => {},
+    dashboardId: 1,
+    dashboardTitle: 'Title',
+    hasUnsavedChanges: false,
+    css: '',
+    onChange: () => {},
+    updateCss: () => {},
+    forceRefreshAllCharts: () => {},
+    startPeriodicRender: () => {},
+    editMode: false,
+    userCanEdit: false,
+    userCanSave: false,
+    layout: {},
+    filters: {},
+    expandedSlices: {},
+    onSave: () => {},
+  };
+
+  function setup(overrideProps) {
+    const wrapper = shallow(
+      <HeaderActionsDropdown {...props} {...overrideProps} />,
+    );
+    return wrapper;
+  }
+
+  it('read-only', () => {
 
 Review comment:
   nit -- I would make each of these (read only, write, write + edit) nested 
`describe` blocks and then have on `it()` per assertion because it's easier for 
debugging. I'm really psyched that you wrote tests for this tho so not a 
blocker.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to