-
Notifications
You must be signed in to change notification settings - Fork 1
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: [TERR-425] React Component Code Coverage and Error Validation #49
Merged
jkafader-esnet
merged 43 commits into
end-to-end-tests
from
test/TERR-425-react-component-code-coverage
Nov 6, 2024
Merged
test: [TERR-425] React Component Code Coverage and Error Validation #49
jkafader-esnet
merged 43 commits into
end-to-end-tests
from
test/TERR-425-react-component-code-coverage
Nov 6, 2024
Conversation
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
- added VS code workspace extension to gitignore - added jest.config - updated yarn.lock - added dev dependencies for @testling-library/react and supporting libs - added setupTests (for Enzyme) - added export of CustomTextAreaSettings interface in CustomTextArea module - added CustomTextArea spec file
- added non default prop settings for .eslintrc - added transformIgnorePatterns for rxjs to jest.config - added test:react script for package.json - removed already extended include prop for tsconfig - updated yarn lock file - fixed bad path to jest-setup.js in setupFilesAfterEnv prop in jest.config - added missing props onPointerEnter/LeaveCapture on use of TextArea Grafana React component with onPointerCapture callback for CustomTextArea component - refactored import of render from @testing-library/react in CustomTextArea spec - refactored expect call on CustomTextArea spec test case to use jest expect.not.toBeUndefined
…l into test/TERR-425-react-component-code-coverage
- updated docker-compose for mitmproxy deployment - updated jest.config to better align with Grafana panel plugin jest.config scaffolding - updated Makefile for E2E testing, mitmproxy support and container spin up sleep timing - updated package.json to better align with Grafana panel plugin scaffolding, rollback to react 17, align types for react and react-dom, added RTL - updated yarn lock to reduce installed versions of react to one - reporting and worker count now dependent on CI in playwright.config - tsconfing updated to allow for import and module resolution when in ts-node context (for react testing) - updated testing in auth.setup to support versions 9 and 10 or later of Grafana - updated config.info to create URLs based on input e2econfig flow sheets - e2econfig updated to included flow sheets in google sheets - updated folderDashboardInit to fix dashboard setup and utilize mock panels and dashboard - updated mock panel json - networkMapPanel json updated to use infinity datasource - plugin-def added to include interfaces - plugin.spec added include test cases for end-to-end, including updates with changes in sidebar for remote URLs - interfaces added for DataSource, Fixtures, HostPost, PanelParams, Threshold, Toplogy, ToplogyNode, TopologyEdge - untyped waitForEvent HOC added - added basic color matcher object module - fix for MapPanel.resolveNodeThresholds to skip layerThreshold computation when nodeThresholds are not an array - added useConfigurationUrl boolean prop in MapOptions, along with IColumn and IFlowSheet interfaces - removed unneedede onPointer*Capture prop usage and callbacks for TextArea instance in CustomTextArea - removed setting of text attributes in esmap since D3.js strips non-SVG conforming attributes out - added removeRepeats fn in test/utils module - fixed imports for RTL screen and render in CustomTextArpea.spec
- removed watch mode from jest react test invocation from package.json - updated playwright.config to run split off of edge coloration tests in seperate module for speed up of parallel execution - split tests into main plugin.spec module and edgeColoration.spec module - renamed parent folder for untypedFn module to util - added fixtures module to avoid repeeated invocations of fixture instatiation code - moved common url related fn for tests into util/urlHelpers module - added check on thresholds in MapPanel to allow for non-array values like null or undefined to bypass forEach invocation - removed unused suffix input param prop in CustomTextArea component - added @ts-ignore flags to minimize TS type error noise from CustomTextArea components in tests due to bad React 17 FC and VFC signatures WRT to children.
- added react testing to make target teest - corrected check on options.layers[layer].nodeThresholds.steps prior to invoking forEach in MapPanel.resolveNodeThresholds - corrected code formatting in CustomTextArea component - added fireEvent.blur after firiing change event to trigger callback
…l into test/TERR-425-react-component-code-coverage
- updated @types/react and @types/react-dom packages to target latest release of ver 17 of each - updated lock file - remaining keyDown test WIP - updated CustomTextArea to be a controlled component, using state to define - initial validation logic added to CustomTextArea, but no reporting of result to UI at present.
- removed unneeded userEvent import from CustomTextArea spec - added styling for JSON validation error messages for coloration and reduced size of error message text - added import of styling to CustomTextArea component - added wrapper to nested TextArea component in CustomTextArea render and error message div
- updated development documentation - removed commented code in edgeColoration.spec and plugin.spec - fixed prop for INetworkMapPanel to be a Partial - added check on options.layers to confirm presence of array, creating one if not present in folderDashboardInit.getFolderDashboardTargets
…workmap-panel into test/TERR-425-react-component-code-coverage
- updated README to use default value of "names" in place of "pops" for endpoint identifier - updated demonstration dashboard.json for above change - updated networkMapPanel.json to align endpointId changes in initial layers - updated module.spec commented test for alignment when the component test is fixed.
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds code coverage reporting (using React Testing Library's use of Jest and Istanbul) to React component testing in the Network Map Grafana Plugin.
This also implements error validation to the UI for the CustomTextArea component and refactors its to utilize a controlled component implementation.
Checklist
type: [TERR-XXX] Short description
type
is one of: 'build', 'ci', 'chore', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'TERR-XXX
refers to a Jira issue.