Skip to content

Commit ba55f34

Browse files
committed
feat: remove enablement logic of sign since it is core feature
1 parent 30761e0 commit ba55f34

File tree

3 files changed

+9
-34
lines changed

3 files changed

+9
-34
lines changed

src/elements/content-sidebar/SidebarNav.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ const SidebarNav = ({
6969
onPanelChange = noop,
7070
signSideBarProps,
7171
}: Props) => {
72-
const { enabled: hasBoxSign } = signSideBarProps;
73-
7472
const handleSidebarNavButtonClick = (sidebarview: string) => {
7573
onPanelChange(sidebarview, false);
7674
};
@@ -151,13 +149,9 @@ const SidebarNav = ({
151149
</SidebarNavButton>
152150
)}
153151
</SidebarNavTablist>
154-
155-
{hasBoxSign && (
156-
<div className="bcs-SidebarNav-secondary">
157-
<SidebarNavSign {...signSideBarProps} />
158-
</div>
159-
)}
160-
152+
<div className="bcs-SidebarNav-secondary">
153+
<SidebarNavSign {...signSideBarProps} />
154+
</div>
161155
{hasAdditionalTabs && (
162156
<div className="bcs-SidebarNav-overflow">
163157
<AdditionalTabs key={fileId} tabs={additionalTabs} />

src/elements/content-sidebar/__tests__/SidebarNav.test.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,23 +114,9 @@ describe('elements/content-sidebar/SidebarNav', () => {
114114
expect(wrapper.find(AdditionalTabPlaceholder)).toHaveLength(5);
115115
});
116116

117-
test('should render the Box Sign entry point if its feature is enabled', () => {
118-
const wrapper = getWrapper(
119-
{
120-
signSideBarProps: {
121-
enabled: true,
122-
onClick: () => {},
123-
},
124-
},
125-
'activity',
126-
features,
127-
);
128-
expect(wrapper.exists(SidebarNavSignButton)).toBe(true);
129-
});
130-
131-
test('should not render the Box Sign entry point if its feature is not enabled', () => {
117+
test('should render the Box Sign entry point', () => {
132118
const wrapper = getWrapper();
133-
expect(wrapper.exists(SidebarNavSignButton)).toBe(false);
119+
expect(wrapper.exists(SidebarNavSignButton)).toBe(true);
134120
});
135121
test('should render docgen tab', () => {
136122
const props = {

src/elements/content-sidebar/__tests__/SidebarNavSignButton.test.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,11 @@ import Tooltip from '../../../components/tooltip';
1010
describe('elements/content-sidebar/SidebarNavSignButton', () => {
1111
const getWrapper = (props = {}) => shallow(<SidebarNavSignButton {...props} />).dive();
1212

13-
test.each`
14-
status | label
15-
${undefined} | ${'Request Signature'}
16-
${'random'} | ${'Request Signature'}
17-
${'active'} | ${'Sign'}
18-
`('should render the correct label based on the current signature status', ({ label, status }) => {
19-
const wrapper = getWrapper({ status });
13+
test('should render the correct label', () => {
14+
const wrapper = getWrapper();
2015

21-
expect(wrapper.find(Tooltip).prop('text')).toBe(label);
22-
expect(wrapper.find(PlainButton).prop('aria-label')).toBe(label);
16+
expect(wrapper.find(Tooltip).prop('text')).toBe('Request Signature');
17+
expect(wrapper.find(PlainButton).prop('aria-label')).toBe('Request Signature');
2318
expect(wrapper.exists(BoxSign28)).toBe(true);
2419
});
2520

0 commit comments

Comments
 (0)