feat(can_share): can share chart and dashboard (#14076)

* feat: share chart  - can_share_chart
share dashboard can_share_dashboard

* fix: pre-commit

* fix: userCanShare tests

* fix: after hugh CR

* fix: adjust after spa refactor
This commit is contained in:
Amit Miran
2021-04-13 13:54:14 +03:00
committed by GitHub
parent b394733ff3
commit 9c5264af0d
10 changed files with 64 additions and 28 deletions

View File

@@ -67,7 +67,7 @@ describe('HeaderActionsDropdown', () => {
}
describe('readonly-user', () => {
const overrideProps = { userCanSave: false };
const overrideProps = { userCanSave: false, userCanShare: false };
it('should render the DropdownButton', () => {
const { wrapper } = setup(overrideProps);
@@ -89,9 +89,9 @@ describe('HeaderActionsDropdown', () => {
expect(menu.find(RefreshIntervalModal)).toExist();
});
it('should render the ShareMenuItems', () => {
it('should not render the ShareMenuItems', () => {
const { menu } = setup(overrideProps);
expect(menu.find(ShareMenuItems)).toExist();
expect(menu.find(ShareMenuItems)).not.toExist();
});
it('should not render the CssEditor', () => {
@@ -101,7 +101,7 @@ describe('HeaderActionsDropdown', () => {
});
describe('write-user', () => {
const overrideProps = { userCanSave: true };
const overrideProps = { userCanSave: true, userCanShare: true };
it('should render the DropdownButton', () => {
const { wrapper } = setup(overrideProps);
@@ -135,7 +135,11 @@ describe('HeaderActionsDropdown', () => {
});
describe('write-user-with-edit-mode', () => {
const overrideProps = { userCanSave: true, editMode: true };
const overrideProps = {
userCanSave: true,
editMode: true,
userCanShare: true,
};
it('should render the DropdownButton', () => {
const { wrapper } = setup(overrideProps);