mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-05 12:50:18 +03:00
fix: making buttons not displaying
This commit is contained in:
parent
d55df5af8b
commit
f25746a242
|
@ -35,14 +35,12 @@ class Json extends React.PureComponent<JsonProps> {
|
|||
<JsonViewerWrap>
|
||||
<SampleControls>
|
||||
{renderCopyButton()}
|
||||
<button
|
||||
onClick={this.expandAll}
|
||||
style={{ display: showFoldingButtons ? 'inline-block' : 'none' }}
|
||||
> Expand all </button>
|
||||
<button
|
||||
onClick={this.collapseAll}
|
||||
style={{ display: showFoldingButtons ? 'inline-block' : 'none' }}
|
||||
> Collapse all </button>
|
||||
{showFoldingButtons &&
|
||||
<>
|
||||
<button onClick={this.expandAll}> Expand all </button>
|
||||
<button onClick={this.collapseAll}> Collapse all </button>
|
||||
</>
|
||||
}
|
||||
</SampleControls>
|
||||
<OptionsContext.Consumer>
|
||||
{(options) => (
|
||||
|
|
|
@ -47,11 +47,8 @@ describe('Components', () => {
|
|||
const flatData = { a: 1, b: '2', c: null };
|
||||
const flatDataComponent = mount(withTheme(<JsonViewer data={flatData} />));
|
||||
|
||||
const expandButton = flatDataComponent.find('div > button[children=" Expand all "]');
|
||||
expect(expandButton.html()).toContain('display: none');
|
||||
|
||||
const collapseButton = flatDataComponent.find('div > button[children=" Collapse all "]');
|
||||
expect(collapseButton.html()).toContain('display: none');
|
||||
expect(flatDataComponent.html()).not.toContain('Expand all');
|
||||
expect(flatDataComponent.html()).not.toContain('Collapse all');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user