Skip to content

Commit

Permalink
feat: remove enablement logic of sign since it is core feature
Browse files Browse the repository at this point in the history
  • Loading branch information
diogostavares committed Jan 10, 2025
1 parent 30761e0 commit ba55f34
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 34 deletions.
12 changes: 3 additions & 9 deletions src/elements/content-sidebar/SidebarNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ const SidebarNav = ({
onPanelChange = noop,
signSideBarProps,
}: Props) => {
const { enabled: hasBoxSign } = signSideBarProps;

const handleSidebarNavButtonClick = (sidebarview: string) => {
onPanelChange(sidebarview, false);
};
Expand Down Expand Up @@ -151,13 +149,9 @@ const SidebarNav = ({
</SidebarNavButton>
)}
</SidebarNavTablist>

{hasBoxSign && (
<div className="bcs-SidebarNav-secondary">
<SidebarNavSign {...signSideBarProps} />
</div>
)}

<div className="bcs-SidebarNav-secondary">
<SidebarNavSign {...signSideBarProps} />
</div>
{hasAdditionalTabs && (
<div className="bcs-SidebarNav-overflow">
<AdditionalTabs key={fileId} tabs={additionalTabs} />
Expand Down
18 changes: 2 additions & 16 deletions src/elements/content-sidebar/__tests__/SidebarNav.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,9 @@ describe('elements/content-sidebar/SidebarNav', () => {
expect(wrapper.find(AdditionalTabPlaceholder)).toHaveLength(5);
});

test('should render the Box Sign entry point if its feature is enabled', () => {
const wrapper = getWrapper(
{
signSideBarProps: {
enabled: true,
onClick: () => {},
},
},
'activity',
features,
);
expect(wrapper.exists(SidebarNavSignButton)).toBe(true);
});

test('should not render the Box Sign entry point if its feature is not enabled', () => {
test('should render the Box Sign entry point', () => {
const wrapper = getWrapper();
expect(wrapper.exists(SidebarNavSignButton)).toBe(false);
expect(wrapper.exists(SidebarNavSignButton)).toBe(true);
});
test('should render docgen tab', () => {
const props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ import Tooltip from '../../../components/tooltip';
describe('elements/content-sidebar/SidebarNavSignButton', () => {
const getWrapper = (props = {}) => shallow(<SidebarNavSignButton {...props} />).dive();

test.each`
status | label
${undefined} | ${'Request Signature'}
${'random'} | ${'Request Signature'}
${'active'} | ${'Sign'}
`('should render the correct label based on the current signature status', ({ label, status }) => {
const wrapper = getWrapper({ status });
test('should render the correct label', () => {
const wrapper = getWrapper();

expect(wrapper.find(Tooltip).prop('text')).toBe(label);
expect(wrapper.find(PlainButton).prop('aria-label')).toBe(label);
expect(wrapper.find(Tooltip).prop('text')).toBe('Request Signature');
expect(wrapper.find(PlainButton).prop('aria-label')).toBe('Request Signature');
expect(wrapper.exists(BoxSign28)).toBe(true);
});

Expand Down

0 comments on commit ba55f34

Please sign in to comment.