Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Migrate DAG.test.js from Enzyme to RTL #1694

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default class DAG extends React.Component {
left: 0,
top: 0,
}}
data-testid="cy"
ref={this.cytoscapeRef}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import React from 'react';
import { mount } from 'enzyme';
import { render, screen } from '@testing-library/react';
import DAG from './DAG';

// mock canvas API (we don't care about canvas results)
Expand Down Expand Up @@ -63,7 +63,8 @@ describe('<DAG>', () => {
parent: 'parent-id',
},
];
expect(mount(<DAG serviceCalls={serviceCalls} />)).toBeDefined();
render(<DAG serviceCalls={serviceCalls} />);
expect(screen.getByTestId('cy')).toBeDefined();
});

it('does not explode with empty strings or string with only spaces', () => {
Expand All @@ -74,6 +75,7 @@ describe('<DAG>', () => {
parent: ' ',
},
];
expect(mount(<DAG serviceCalls={serviceCalls} />)).toBeDefined();
render(<DAG serviceCalls={serviceCalls} />);
expect(screen.getByTestId('cy')).toBeDefined();
});
});