mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-06 21:30:21 +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>
|
<JsonViewerWrap>
|
||||||
<SampleControls>
|
<SampleControls>
|
||||||
{renderCopyButton()}
|
{renderCopyButton()}
|
||||||
<button
|
{showFoldingButtons &&
|
||||||
onClick={this.expandAll}
|
<>
|
||||||
style={{ display: showFoldingButtons ? 'inline-block' : 'none' }}
|
<button onClick={this.expandAll}> Expand all </button>
|
||||||
> Expand all </button>
|
<button onClick={this.collapseAll}> Collapse all </button>
|
||||||
<button
|
</>
|
||||||
onClick={this.collapseAll}
|
}
|
||||||
style={{ display: showFoldingButtons ? 'inline-block' : 'none' }}
|
|
||||||
> Collapse all </button>
|
|
||||||
</SampleControls>
|
</SampleControls>
|
||||||
<OptionsContext.Consumer>
|
<OptionsContext.Consumer>
|
||||||
{(options) => (
|
{(options) => (
|
||||||
|
|
|
@ -47,11 +47,8 @@ describe('Components', () => {
|
||||||
const flatData = { a: 1, b: '2', c: null };
|
const flatData = { a: 1, b: '2', c: null };
|
||||||
const flatDataComponent = mount(withTheme(<JsonViewer data={flatData} />));
|
const flatDataComponent = mount(withTheme(<JsonViewer data={flatData} />));
|
||||||
|
|
||||||
const expandButton = flatDataComponent.find('div > button[children=" Expand all "]');
|
expect(flatDataComponent.html()).not.toContain('Expand all');
|
||||||
expect(expandButton.html()).toContain('display: none');
|
expect(flatDataComponent.html()).not.toContain('Collapse all');
|
||||||
|
|
||||||
const collapseButton = flatDataComponent.find('div > button[children=" Collapse all "]');
|
|
||||||
expect(collapseButton.html()).toContain('display: none');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user