-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KOGITO-9474: [SWF Dev UI] Enzyme to RTL migration (#1814)
* KOGITO-9474: [SWF Dev UI] Enzyme to RTL migration * Migrated unit tests on CustomDashboarList and View packages * Migrated unit tests on Monitoring package * Migrated unit tests on Ouia tools package * Migrated unit tests on Workflow-form package * Migrated unit tests on Process-definition-list package * Migrated Unit Tests on runtime-gateway-api package * Migrated unit tests on Cloud-event-form package * Snapshots enhancements * migrate process-list, process-details (#12) * test fixes * Runtime-tools-devui test updates * test fixes --------- Co-authored-by: Ajay Jaganathan <[email protected]>
- Loading branch information
Showing
289 changed files
with
60,735 additions
and
86,042 deletions.
There are no files selected for viewing
4 changes: 1 addition & 3 deletions
4
ui-packages/packages/cloud-event-form/config/Jest-config/test-setup.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
const enzyme = require('enzyme'); | ||
const Adapter = require('@wojtekmaj/enzyme-adapter-react-17'); | ||
require('jest-canvas-mock'); | ||
const { TextDecoder } = require('util'); | ||
|
||
global.TextDecoder = TextDecoder; | ||
enzyme.configure({ adapter: new Adapter() }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2023 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
module.exports = { | ||
setupFiles: [ | ||
'./config/Jest-config/test-shim.js', | ||
'./config/Jest-config/test-setup.js', | ||
'core-js' | ||
], | ||
moduleFileExtensions: ['ts', 'tsx', 'js'], | ||
coveragePathIgnorePatterns: [ | ||
'./src/static', | ||
'./src/api/', | ||
'dist/', | ||
'./src/envelope/WorkflowFormEnvelope.tsx', | ||
'./src/embedded/tests/utils/Mocks.ts', | ||
'./src/envelope/tests/mocks/Mocks.ts', | ||
'./src/envelope/CloudEventFormEnvelope.tsx', | ||
'./src/envelope/index.ts' | ||
], | ||
coverageReporters: [ | ||
[ | ||
'lcov', | ||
{ | ||
projectRoot: '../../' | ||
} | ||
] | ||
], | ||
transformIgnorePatterns: [], | ||
transform: { | ||
'^.+.jsx?$': './config/Jest-config/babel-jest-wrapper.js', | ||
'^.+.(ts|tsx)$': 'ts-jest', | ||
'.(jpg|jpeg|png|svg)$': './config/Jest-config/fileMocks.js' | ||
}, | ||
testMatch: ['**/tests/*.(ts|tsx|js)'], | ||
moduleNameMapper: { | ||
'.(scss|sass|css)$': 'identity-obj-proxy', | ||
'monaco- editor': '<rootDir>/__mocks__/monacoMock.js' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 9 additions & 91 deletions
100
...es/cloud-event-form/src/embedded/tests/__snapshots__/EmbeddedCloudEventForm.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`EmbeddedCloudEventForm tests Snapshot - defaultValue 1`] = ` | ||
<ForwardRef | ||
defaultValues={ | ||
Object { | ||
"cloudEventSource": "/local/source", | ||
"instanceId": "1234", | ||
} | ||
} | ||
driver={ | ||
Object { | ||
"triggerCloudEvent": [MockFunction], | ||
} | ||
} | ||
targetOrigin="origin" | ||
> | ||
<ForwardRef(RefForwardingEmbeddedEnvelope) | ||
apiImpl={ | ||
EmbeddedCloudEventFormChannelApiImpl { | ||
"driver": Object { | ||
"triggerCloudEvent": [MockFunction], | ||
}, | ||
} | ||
} | ||
config={ | ||
Object { | ||
"containerType": "div", | ||
} | ||
} | ||
origin="origin" | ||
pollInit={[Function]} | ||
refDelegate={[Function]} | ||
> | ||
<div /> | ||
</ForwardRef(RefForwardingEmbeddedEnvelope)> | ||
</ForwardRef> | ||
<div> | ||
<div /> | ||
</div> | ||
`; | ||
|
||
exports[`EmbeddedCloudEventForm tests Snapshot - isNewInstanceEvent 1`] = ` | ||
<ForwardRef | ||
driver={ | ||
Object { | ||
"triggerCloudEvent": [MockFunction], | ||
} | ||
} | ||
isNewInstanceEvent={true} | ||
targetOrigin="origin" | ||
> | ||
<ForwardRef(RefForwardingEmbeddedEnvelope) | ||
apiImpl={ | ||
EmbeddedCloudEventFormChannelApiImpl { | ||
"driver": Object { | ||
"triggerCloudEvent": [MockFunction], | ||
}, | ||
} | ||
} | ||
config={ | ||
Object { | ||
"containerType": "div", | ||
} | ||
} | ||
origin="origin" | ||
pollInit={[Function]} | ||
refDelegate={[Function]} | ||
> | ||
<div /> | ||
</ForwardRef(RefForwardingEmbeddedEnvelope)> | ||
</ForwardRef> | ||
<div> | ||
<div /> | ||
</div> | ||
`; | ||
|
||
exports[`EmbeddedCloudEventForm tests Snapshot 1`] = ` | ||
<ForwardRef | ||
driver={ | ||
Object { | ||
"triggerCloudEvent": [MockFunction], | ||
} | ||
} | ||
targetOrigin="origin" | ||
> | ||
<ForwardRef(RefForwardingEmbeddedEnvelope) | ||
apiImpl={ | ||
EmbeddedCloudEventFormChannelApiImpl { | ||
"driver": Object { | ||
"triggerCloudEvent": [MockFunction], | ||
}, | ||
} | ||
} | ||
config={ | ||
Object { | ||
"containerType": "div", | ||
} | ||
} | ||
origin="origin" | ||
pollInit={[Function]} | ||
refDelegate={[Function]} | ||
> | ||
<div /> | ||
</ForwardRef(RefForwardingEmbeddedEnvelope)> | ||
</ForwardRef> | ||
<div> | ||
<div /> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.