forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(domain) Add ability to edit a Domain name from the UI (datahub-p…
- Loading branch information
1 parent
0d9ac76
commit 14d7e34
Showing
6 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
datahub-web-react/src/app/entity/shared/containers/profile/__tests__/EntityHeader.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { platformPrivileges } from '../../../../../../Mocks'; | ||
import { EntityType } from '../../../../../../types.generated'; | ||
import { getCanEditName } from '../header/EntityHeader'; | ||
|
||
describe('getCanEditName', () => { | ||
it('should return true for Terms if manageGlossaries privilege is true', () => { | ||
const canEditName = getCanEditName(EntityType.GlossaryTerm, platformPrivileges); | ||
|
||
expect(canEditName).toBe(true); | ||
}); | ||
|
||
it('should return false for Terms if manageGlossaries privilege is false', () => { | ||
const privilegesWithoutGlossaries = { ...platformPrivileges, manageGlossaries: false }; | ||
const canEditName = getCanEditName(EntityType.GlossaryTerm, privilegesWithoutGlossaries); | ||
|
||
expect(canEditName).toBe(false); | ||
}); | ||
|
||
it('should return true for Nodes if manageGlossaries privilege is true', () => { | ||
const canEditName = getCanEditName(EntityType.GlossaryNode, platformPrivileges); | ||
|
||
expect(canEditName).toBe(true); | ||
}); | ||
|
||
it('should return false for Nodes if manageGlossaries privilege is false', () => { | ||
const privilegesWithoutGlossaries = { ...platformPrivileges, manageGlossaries: false }; | ||
const canEditName = getCanEditName(EntityType.GlossaryNode, privilegesWithoutGlossaries); | ||
|
||
expect(canEditName).toBe(false); | ||
}); | ||
|
||
it('should return true for Domains if manageDomains privilege is true', () => { | ||
const canEditName = getCanEditName(EntityType.Domain, platformPrivileges); | ||
|
||
expect(canEditName).toBe(true); | ||
}); | ||
|
||
it('should return false for Domains if manageDomains privilege is false', () => { | ||
const privilegesWithoutDomains = { ...platformPrivileges, manageDomains: false }; | ||
const canEditName = getCanEditName(EntityType.Domain, privilegesWithoutDomains); | ||
|
||
expect(canEditName).toBe(false); | ||
}); | ||
|
||
it('should return false for an unsupported entity', () => { | ||
const canEditName = getCanEditName(EntityType.Chart, platformPrivileges); | ||
|
||
expect(canEditName).toBe(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters