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

build(deps): upgrade to Patternfly 5 #1303

Merged
merged 24 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d7a928f
build(deps): upgrade to Patternfly 5 (#1153)
tthvo Jul 15, 2024
bb154cd
chore(pf5): upgrade TargetContextSelector (#1304)
andrewazores Jul 25, 2024
da18bc0
fix(masthead): correct styling of masthead icons and quickstart menu …
andrewazores Jul 29, 2024
783413c
Merge branch 'main' into pf5
andrewazores Jul 30, 2024
d8b62d5
chore(pf5): upgrade Topology View to Patternfly 5 (#1308)
tthvo Jul 31, 2024
bbb0be0
chore(type): remove unused auth components and fix type-check (#1316)
tthvo Jul 31, 2024
d719eef
chore(rules): migrate Automated Rules view to pf5 (#1317)
tthvo Aug 2, 2024
4e7dd43
Merge remote-tracking branch 'upstream/main' into pf5
andrewazores Aug 13, 2024
f6b34c7
chore(pf5): use new background image for About modal (#1326)
tthvo Aug 13, 2024
b6c4d70
chore(pf5): upgrade Recording view to Patternfly 5 (#1318)
tthvo Aug 14, 2024
8c0395e
Merge branch 'main' into pf5
andrewazores Aug 15, 2024
bc70e39
chore(pf5): upgrade Settings view to Patternfly 5 (#1330)
tthvo Aug 22, 2024
d7ce2a5
chore(pf5): revamp general table styles and upgrade archive/events vi…
tthvo Sep 3, 2024
ad5a975
chore(pf5): upgrade Security view to Patternfly 5 (#1333)
tthvo Sep 3, 2024
7eadcff
fix(topology): fix Cola layout failing due to pending outdated graph …
tthvo Sep 3, 2024
822c662
Merge branch 'main' into pf5
andrewazores Sep 3, 2024
4ca6d0b
chore(pf5): upgrade Dashboard view to Patternfly 5 (#1342)
tthvo Sep 4, 2024
9ab12b9
chore: upgrade 404 page to Patternfly 5 (#1344)
tthvo Sep 6, 2024
8a2cbb9
feat(recordings): UI improvements for recording filters (#1335)
tthvo Sep 6, 2024
3582233
fix(about): add missing buildInfo in mocked health response (#1345)
tthvo Sep 9, 2024
fb87a10
fix(pf5): allow menu footer to be sticky and use danger style for del…
tthvo Sep 9, 2024
40d1582
test(pf5): fix broken tests after PF5 upgrades (#1347)
tthvo Sep 13, 2024
eefc30e
fix(topology): filter options should show unique value only (#1349)
tthvo Sep 13, 2024
fd5e7c6
fix(credentials): number of matched targets should be updated corretl…
tthvo Sep 16, 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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ coverage
storybook-static
.build_cache
.eslintcache
.cache*

# Old locale files
locales/**/*_old.json
7 changes: 6 additions & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ In order to render the component under test into its HTML DOM representation and

* To search for a localized text, for example, with `getByText`, use `testTranslate` function from `@test/Common.tsx` to return a translated text. Tests are configued to use `en` locale as default.

* If any of the test codes cause the changes in React states (e.g. open/close a action menu or modal), wrap them in [`act`](https://testing-library.com/docs/react-testing-library/api/#act) function, imported from `@testing-library/react`. The `act` function allows flushing all pending state changes.

## MOCKING

### Overview
Expand Down Expand Up @@ -83,6 +85,8 @@ Where the `-u` flag tells Jest to update the snapshot and the `-t` flag specifie

* Some PatternFly components use random, dynamic strings as `ids` which will then be displayed as elements in the rendered React virtual DOM. These strings change upon every render, causing snapshots to fail even though the component under test is still functionally the same. This can be remedied by supplying [custom `ids` as props](https://github.com/patternfly/patternfly-react/issues/3518) to the culprit PatternFly child components inside the source file of the component under test.

* Since `react-test-renderer` does not support the use of `ref` (see [reference](https://github.com/facebook/react/issues/7740)), the tests might fail if any third-party codes use `ref` unsafely (without checking `null`). To workaround that, use [`createNodeMock`](https://legacy.reactjs.org/docs/test-renderer.html#ideas) to construct a mock `ref` when calling `renderSnapshot`.


## INTEGRATION TESTING

Expand All @@ -107,6 +111,7 @@ This will automatically start a Mirage dev server, run the integration tests on

### Tips
* Running the integration tests will open a Firefox browser and simulate any actions that you instruct the browser to perform. That means we must first navigate to the local Cryostat Web page, before performing any useful testing.

* In our `beforeAll` jest declaration, we setup our web driver with the [default configurations](src/itest/util.ts)), and then use that driver to create our first **Page Object**. A Page Object is an abstraction that acts as an interface to your web pages. For more info on the **Page Object Model** in Selenium, see https://www.selenium.dev/documentation/test_practices/encouraged/page_object_models/.
```ts
beforeAll(async function () {
Expand Down Expand Up @@ -135,4 +140,4 @@ Add more methods to each PO, to test more actions. The point is, we want to abst
In the code, we first tell the driver to wait, until an element is located by the css selector ('button[data-action="skip"]'), and assign it to a variable. If not found, we assign null. Then if the variable is non-null, we click it. To find a good query to use, it is recommended to use the [Selenium IDE](https://addons.mozilla.org/en-CA/firefox/addon/selenium-ide/) extension on your browser. The extension allows you to easily see queries that can be used to select an element you want.
* Integration tests are found in [src/itest](src/itest).
* All code is asynchronous which entails the use of the `async/await` pattern.
* Follow the Selenium testing practices when writing integration tests: https://www.selenium.dev/documentation/test_practices/.
* Follow the Selenium testing practices when writing integration tests: https://www.selenium.dev/documentation/test_practices/.
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ module.exports = {

// An array of regexp pattern strings that are matched against all source file paths before transformation.
// If the file path matches any of the patterns, it will not be transformed.
transformIgnorePatterns: ["/node_modules/(?!@patternfly)"],
transformIgnorePatterns: [
"/node_modules/(?!@patternfly|d3|d3-array|internmap|delaunator|robust-predicates)",
],

roots: ['<rootDir>/src']
};
42 changes: 36 additions & 6 deletions locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,94 @@
{
"ADD": "Add",
"ARCHIVAL_PERIOD": "Archival Period",
"AriaLabels": {
"MAXIMUM_AGE": "Maximum age value",
"MAXIMUM_AGE_UNITS_INPUT": "Maximum age units input",
"MAXIMUM_SIZE": "Maximum size value",
"MAXIMUM_SIZE_UNITS_INPUT": "Maximum size units input"
},
"BETA": "BETA",
"AUTOMATED_RULES": "Automated Rules",
"BETA": "Beta",
"CANCEL": "Cancel",
"CARD_TYPE": "Card type",
"CAUTION": "Caution",
"CLEAN": "Clean",
"CLEAR": "Clear",
"CLEAR_FILTERS": "Clear all filters",
"CLEAR_RECENT": "Clear recent",
"CLOSE": "Close",
"COPIED": "Copied",
"COPY": "Copy",
"CREATE": "Create",
"CREATING": "Creating",
"CRITICAL": "CRITICAL",
"CRYOSTAT_TRADEMARK": "Copyright The Cryostat Authors, The Apache License, Version 2.0",
"DATE": "Date",
"DELETE": "Delete",
"DESCRIPTION": "Description",
"DEVELOPMENT": "DEVELOPMENT",
"DEVELOPMENT": "Development",
"DISABLE": "Disable",
"DONOT_ASK_AGAIN": "Don't ask me again",
"DOWNLOAD": "Download",
"DURATION": "Duration",
"EDIT": "Edit",
"ENABLED": "Enabled",
"EVENT_SPECIFIER": "Event Specifier",
"FILTER_NAME": "Name",
"FILTER_TOPIC": "Topic",
"FROM": "From",
"HELP": "Help",
"HOUR": "Hour",
"HOUR_one": "Hour",
"HOUR_other": "Hours",
"MAXIMUM_AGE": "Maximum age",
"HOUR_compact": "h",
"INITIAL_DELAY": "Initial Delay",
"LABEL": "Label",
"MATCH_EXPRESSION": "Match Expression",
"MAXIMUM_AGE": "Maximum Age",
"MAXIMUM_AGE_HELPER_TEXT": "The maximum age of Recording data stored to disk.",
"MAXIMUM_SIZE": "Maximum size",
"MAXIMUM_SIZE": "Maximum Size",
"MAXIMUM_SIZE_HELPER_TEXT": "The maximum size of Recording data saved to disk.",
"MERIDIEM_AM": "AM",
"MERIDIEM_PM": "PM",
"MILLISECOND_other": "Milliseconds",
"MINUTE": "Minute",
"MINUTE_one": "Minute",
"MINUTE_other": "Minutes",
"MINUTE_compact": "m",
"N/A": "N/A",
"NAME": "Name",
"NO_DESCRIPTION": "No description",
"OK": "OK",
"PRODUCTION": "PRODUCTION",
"PRESERVED_ARCHIVES": "Preserved Archives",
"PRODUCTION": "Production",
"REFRESH": "Refresh",
"REMOVE": "Remove",
"RENAME": "Rename",
"RESET": "Reset",
"RETRY": "Retry",
"SAVE": "Save",
"SCORE": "Score",
"SECOND": "Second",
"SECOND_one": "Second",
"SECOND_other": "Seconds",
"SECOND_compact": "s",
"SELECT": "Select",
"SHOW_LESS": "Show less",
"SHOW_MORE": "Show more",
"SOMETHING_WENT_WRONG": "Something went wrong",
"STATE": "State",
"STATUS": "Status",
"SUBMIT": "Submit",
"SUBMITTING": "Submitting",
"SUGGESTED": "Suggested",
"TARGET": "Target",
"TEMPLATE": "Template",
"TEST": "Test",
"TIME": "Time",
"UPLOAD": "Upload",
"TIMEZONE": "Timezone",
"TO": "To",
"UNKNOWN_ERROR": "Unknown error",
"USER_SUBMITTED": "User-submitted",
"VIEW": "View",
"VIEW_MORE": "View more",
Expand Down
Loading
Loading