mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
chore: fix tests
This commit is contained in:
parent
30a27c116b
commit
371f3dfc4e
|
@ -62,7 +62,7 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
|
|||
style={{ marginRight: '-25px' }}
|
||||
/>
|
||||
</EndpointInfo>
|
||||
<ServersOverlay expanded={expanded}>
|
||||
<ServersOverlay expanded={expanded} aria-hidden={!expanded}>
|
||||
{operation.servers.map(server => {
|
||||
const normalizedUrl = options.expandDefaultServerVariables
|
||||
? expandDefaultServerVariables(server.url, server.variables)
|
||||
|
|
|
@ -67,7 +67,8 @@ export const ServersOverlay = styled.div<{ expanded: boolean }>`
|
|||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
transition: all 0.25s ease;
|
||||
${props => (props.expanded ? '' : 'transform: translateY(-50%) scaleY(0);')}
|
||||
visibility: hidden;
|
||||
${props => (props.expanded ? 'visibility: visible;' : 'transform: translateY(-50%) scaleY(0);')}
|
||||
`;
|
||||
|
||||
export const ServerItem = styled.div`
|
||||
|
|
|
@ -25,11 +25,11 @@ describe('Components', () => {
|
|||
|
||||
test('should collapse/uncollapse', () => {
|
||||
expect(component.html()).not.toContain('class="hoverable"'); // all are collapsed by default
|
||||
const expandAll = component.find('div > span[children=" Expand all "]');
|
||||
const expandAll = component.find('div > button[children=" Expand all "]');
|
||||
expandAll.simulate('click');
|
||||
expect(component.html()).toContain('class="hoverable"'); // all are collapsed
|
||||
|
||||
const collapseAll = component.find('div > span[children=" Collapse all "]');
|
||||
const collapseAll = component.find('div > button[children=" Collapse all "]');
|
||||
collapseAll.simulate('click');
|
||||
expect(component.html()).not.toContain('class="hoverable"'); // all are collapsed
|
||||
});
|
||||
|
@ -37,7 +37,7 @@ describe('Components', () => {
|
|||
test('should collapse/uncollapse', () => {
|
||||
ClipboardService.copySelected = jest.fn();
|
||||
|
||||
const copy = component.find('span[onClick]').first();
|
||||
const copy = component.find('button[onClick]').first();
|
||||
copy.simulate('click');
|
||||
|
||||
expect(ClipboardService.copySelected as jest.Mock).toHaveBeenCalled();
|
||||
|
|
Loading…
Reference in New Issue
Block a user