Skip to content

Commit

Permalink
fix remaining tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MiriamAparicio committed Dec 17, 2024
1 parent 22acebf commit e8fc25a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { composeStories } from '@storybook/testing-react';
import React from 'react';
import { mount } from 'enzyme';
import { EuiThemeProvider } from '@elastic/eui';
import * as stories from './exception_stacktrace.stories';
import { ExceptionStackTraceTitleProps } from './exception_stacktrace_title';

Expand All @@ -17,10 +18,16 @@ describe('ExceptionStacktrace', () => {
describe('render', () => {
describe('with stacktraces', () => {
it('renders the stacktraces', () => {
expect(mount(<JavaWithLongLines />).find('Stacktrace')).toHaveLength(3);
expect(
mount(<JavaWithLongLines />, {
wrappingComponent: EuiThemeProvider,
}).find('Stacktrace')
).toHaveLength(3);
});
it('should have the title in a specific format', function () {
const wrapper = mount(<JavaWithLongLines />).find('ExceptionStacktraceTitle');
const wrapper = mount(<JavaWithLongLines />, {
wrappingComponent: EuiThemeProvider,
}).find('ExceptionStacktraceTitle');
expect(wrapper).toHaveLength(1);
const { type, message } = wrapper.props() as ExceptionStackTraceTitleProps;
expect(wrapper.text()).toContain(`${type}: ${message}`);
Expand All @@ -29,7 +36,11 @@ describe('ExceptionStacktrace', () => {

describe('with more than one stack trace', () => {
it('renders cause stacktraces', () => {
expect(mount(<JavaWithLongLines />).find('CauseStacktrace')).toHaveLength(2);
expect(
mount(<JavaWithLongLines />, {
wrappingComponent: EuiThemeProvider,
}).find('CauseStacktrace')
).toHaveLength(2);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ cytoscape.use(dagre);

const euiTheme = {
size: { avatarSizing: { l: { size: 10 } } },
animation: { normal: '1s' },
} as unknown as EuiThemeComputed;

describe('useCytoscapeEventHandlers', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('StickyProperties', () => {

const wrapper = shallow(<StickyProperties stickyProperties={stickyProperties} />)
.find('PropertyValue')
.dive()
.render()
.text();

expect(wrapper).toEqual('1337');
Expand Down

0 comments on commit e8fc25a

Please sign in to comment.