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(RHINENG-3032): Migrate from Enzyme to RTL #2033

Merged
merged 53 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
a83c102
chore: Support RTL and install dependencies
gkarat Oct 25, 2023
0d4f92a
chore(Cards): Convert tests to testing-library
gkarat Oct 25, 2023
b9f63bc
chore: Introduce RouterWrapper
gkarat Oct 2, 2023
1bd0b2e
chore: Enhance TestWrapper and include redux provider
gkarat Oct 5, 2023
ee06c3d
chore(EditButton): Convert tests to testing-library
gkarat Oct 5, 2023
0abdc8d
chore(ConfigurationCard): Convert test to testing-library
gkarat Oct 5, 2023
17d12ea
chore(InfrastructureCard): Convert tests to testing-library
gkarat Oct 5, 2023
d915fbb
chore(BiosCard): Convert tests to testing-library
gkarat Oct 5, 2023
653be44
chore(CollectionCard): Convert tests to testing-library
gkarat Oct 5, 2023
8edc4a7
chore: Fix default store argument for TestWrapper
gkarat Oct 6, 2023
da7db78
chore(LoadingCard): Convert tests to testing-library
gkarat Oct 6, 2023
31caf55
chore(EntityTable): Convert tests to testing-library
gkarat Oct 10, 2023
48bc8c9
chore(TagWithDialog): Convert tests to testing-library
gkarat Oct 10, 2023
afe372a
chore(OperatingSystemFormatter): Convert tests to testing-library
gkarat Oct 10, 2023
efcb2d9
chore(EntityTableToolbar): Convert tests to testing-library
gkarat Oct 25, 2023
be399b1
chore(TagsModal): Convert tests to testing-library
gkarat Oct 25, 2023
4321d9b
chore(Pagination): Convert tests to testing-library
gkarat Dec 19, 2023
34da58f
chore(DeleteModal): Convert tests to testing-library
gkarat Dec 19, 2023
141a667
chore(SystemIssues): Migrate tests to RTL
gkarat Jan 2, 2024
fe13fbc
chore(GeneralInformation): Converts tests to RTL
gkarat Jan 5, 2024
90d4f28
chore(SystemStatusCard): Convert tests to RTL
gkarat Jan 5, 2024
b3e8f11
chore(TextInputModal): Convert tests to RTL
gkarat Jan 5, 2024
ddf246e
chore(BasicInfo): Convert tests to RTL
gkarat Jan 5, 2024
060f495
chore(NoEntitiesFound): Convert tests to RTL
gkarat Jan 5, 2024
a15f8cf
chore(Hooks): Migrate hook tests to RTL
gkarat Jan 15, 2024
91f4b0e
chore(Helpers): Migrate tests to RTL
gkarat Jan 16, 2024
a598499
chore(InfoTable): Migrate to RTL
gkarat Jan 16, 2024
4bef474
chore(OperatingSystemCard): Migrate test to RTL
gkarat Jan 16, 2024
63b72fb
chore(SystemCard): Migrate tests to RTL
gkarat Jan 16, 2024
e7285e1
chore(DetailWrapper): Migrate test to RTL
gkarat Jan 17, 2024
56b5cc3
chore(InventoryList): Migrate test to RTL
gkarat Jan 17, 2024
dfafacb
chore(ConventionalSystemsTab): Migrate test to RTL
gkarat Jan 17, 2024
9649731
chore(SystemNotFound): Migrate test to RTL
gkarat Jan 17, 2024
8f14a15
chore(InventoryTable): Migrate tests to RTL
gkarat Jan 20, 2024
418a89f
chore(TopBar): Migrate tests to RTL
gkarat Jan 20, 2024
9a39d38
chore: Remove remaining enzyme setup and packages
gkarat Jan 20, 2024
45904bb
chore: Cut unnecessary mocks and configuration
gkarat Jan 20, 2024
97b4ac9
chore: Eliminate all lint errors
gkarat Jan 20, 2024
f5a84a8
chore: Fix remaining test errors
gkarat Jan 22, 2024
fa595f9
test(ConventionalSystemsTab): Use shouldDispatch to check actions
gkarat Jan 23, 2024
08b9543
chore(TagsModal): Improve tests
gkarat Jan 29, 2024
4cf385b
chore: Improve rows assertions
gkarat Jan 29, 2024
46af168
chore(DeleteModal): Remove unncecessary test
gkarat Jan 29, 2024
6113ecb
chore(DetailWrapper): Test showTags parameter
gkarat Jan 29, 2024
03a8e18
chore: Deprecate renderWithRouter
gkarat Jan 29, 2024
cd6d034
chore: Improve naming in ConventionalSystemsTab.test.js
gkarat Jan 29, 2024
94811f1
chore(useGroupFilter): Use toMatchObject where possible
gkarat Jan 31, 2024
798ab9c
chore(InventoryTable): Set feature flags to false by default
gkarat Jan 31, 2024
c93961a
chore(SystemCard): Remove unnecessary router mock
gkarat Jan 31, 2024
c7a0bd3
chore: Clean deprecated snapshots
gkarat Jan 31, 2024
7f65603
chore(dataMapper): Add comments, separate by describe's
gkarat Jan 31, 2024
346bda1
Merge branch 'master' into rtl
gkarat Feb 6, 2024
623d3d1
chore: Improve test descriptions for SystemCard
gkarat Feb 6, 2024
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
14 changes: 2 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@ module.exports = {
extends: [
'@redhat-cloud-services/eslint-config-redhat-cloud-services',
'plugin:cypress/recommended',
'plugin:testing-library/react',
'plugin:jest-dom/recommended',
],
globals: {
insights: 'readonly',
shallow: 'readonly',
render: 'readonly',
mount: 'readonly',
IS_DEV: 'readonly',
},
rules: {
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
},
};
23 changes: 0 additions & 23 deletions config/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/* eslint-disable camelcase */
import { configure, mount, render, shallow } from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import React from 'react';
import 'whatwg-fetch';
jest.mock('react', () => ({
...jest.requireActual('react'),
useLayoutEffect: jest.requireActual('react').useEffect,
}));

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useParams: () => ({
inventoryId: '07c86de4-dadd-4681-8e6c-fe0baaaef479',
}),
}));

jest.mock('@redhat-cloud-services/frontend-components/useChrome', () => ({
__esModule: true,
default: () => ({
Expand Down Expand Up @@ -47,8 +30,6 @@ jest.mock('@redhat-cloud-services/frontend-components/useChrome', () => ({
}),
}));

configure({ adapter: new Adapter() });

global.insights = {
chrome: {
auth: {
Expand Down Expand Up @@ -77,8 +58,4 @@ global.insights = {
},
};

global.shallow = shallow;
global.render = render;
global.mount = mount;
global.React = React;
global.IS_DEV = true;
Loading