mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-06 21:30:21 +03:00
Test buttons visibility
This commit is contained in:
parent
d4738945ec
commit
8f72da450d
|
@ -42,5 +42,16 @@ describe('Components', () => {
|
|||
|
||||
expect(ClipboardService.copySelected as jest.Mock).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('Expand/Collapse buttons disappears for flat structures', () => {
|
||||
const flatData = { a: 1, b: '2' };
|
||||
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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user