Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nickakhmetov/HMP-103 Improve publication cypress tests (#3145)
* Ignore `settings.json`, add `default.settings.json` * bump linting-related dependencies, add typescrip-eslint deps, remove babel * WIP - adding typescript, updating eslint config * Expand eslint/prettier config * Get tsconfig working, adjust swcrc config to allow typescript * target more file types with eslint formatter * allow webpack files to import devDependencies * Apply webpack overrides to entire build-utils folder to cover alias.js as well * add paths to tsconfig, add optional config to default settings, add autopep8 to recommended extensions * No need to limit to only `node` types * remove babel dependencies * added changelog * `npm run lint:fix` autofixes only converted components to use `function` adjusts jest tests to use `not.toBeInTheDocument` instead of `toBeNull` removes unnecessary fragments removes trailing spaces * Fix `react/no-unstable-nested-components` error Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “VerticalStackedBarChart” and pass data as props. * allow use of require in jest tests * fix resolution of `fonts.ts` file asking for the extension * Fix `react/jsx-no-constructed-context-values` errors The object passed as the value prop to the Context provider changes every render. To fix this consider wrapping it in a useMemo hook I also turned the functions in the Files component into callbacks since they're provided in the context * Allow helpers that contain `expect` statements to be used as the only expects in tests * add tsconfig to dockerfile * Fix `react/no-unstable-nested-components` with `DetailPanel` getting defined inside of `ProvGraph` * Fix undefined `test` global in test fixtures * Disable `jsx-no-bind` rule * Must use destructuring `themeContext` assignment (`react/destructuring-assignment`) * `Default parameters should be last` * Reorganized debounced vitessce config setter to avoid using `useCallback` with unknown dependencies * Name HOC components (`func-names`) * fix `no-unused-vars`; allow unused vars if they start with `_` prefix * use destructuring props assignment * `react/jsx-no-constructed-context-values` The object passed as the value prop to the Context provider changes every render. To fix this consider wrapping it in a useMemo hook * allow empty function placeholders in test files * add assertions to accordion list filter tests * Avoid destructuring queries from `render` result, use `screen.getByText` instead * another "screen" fix * allow "redundant" story names pending further investigation * reorganize to make sure components are only referenced after they're defined, fix optional chain safety * uncomment test for the time being, will troubleshoot * prepend unused var with `_` * fix describe block name * remove `as default`, make it an explicit default export * allow variables to remain unused if spreading object to remove those keys * Add explicit explanation for empty effect cleanup function * Use `getBy*` queries rather than `queryBy*` for checking element is present `testing-library/prefer-presence-queries` * explicitly use default export instead of `as default` * use `useMemo` to manage SearchKitManager instance to fix `useEffect` dependencies * add swc helpers package to dev dependencies to make jest test suites run successfully * Fix ProvVis test * fix accordion filter tests * Add `buffer` polyfill to make docker image build correctly * Fix maintenance cypress test * rework existing tests to work with vitessce publication * remove waits from tests, add tests for authors/provenance sections * test vignette accordion * Add changelog * propagate changes to `.eslintrc.yml` from fixes branch * remove unnecessary usecallbacks * Update context/app/static/js/components/entity-search/SearchWrapper/utils.spec.js Co-authored-by: John Conroy <[email protected]> * Fix Jest test-utils resolution * remove unnecessary import * Update CHANGELOG-lint-updates.md Co-authored-by: John Conroy <[email protected]> * Change ProvData constructor to an object * Nickakhmetov/HMP-194 Apply fixes from lint config (#3143) * `npm run lint:fix` autofixes only converted components to use `function` adjusts jest tests to use `not.toBeInTheDocument` instead of `toBeNull` removes unnecessary fragments removes trailing spaces * Fix `react/no-unstable-nested-components` error Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “VerticalStackedBarChart” and pass data as props. * allow use of require in jest tests * fix resolution of `fonts.ts` file asking for the extension * Fix `react/jsx-no-constructed-context-values` errors The object passed as the value prop to the Context provider changes every render. To fix this consider wrapping it in a useMemo hook I also turned the functions in the Files component into callbacks since they're provided in the context * Allow helpers that contain `expect` statements to be used as the only expects in tests * add tsconfig to dockerfile * Fix `react/no-unstable-nested-components` with `DetailPanel` getting defined inside of `ProvGraph` * Fix undefined `test` global in test fixtures * Disable `jsx-no-bind` rule * Must use destructuring `themeContext` assignment (`react/destructuring-assignment`) * `Default parameters should be last` * Reorganized debounced vitessce config setter to avoid using `useCallback` with unknown dependencies * Name HOC components (`func-names`) * fix `no-unused-vars`; allow unused vars if they start with `_` prefix * use destructuring props assignment * `react/jsx-no-constructed-context-values` The object passed as the value prop to the Context provider changes every render. To fix this consider wrapping it in a useMemo hook * allow empty function placeholders in test files * add assertions to accordion list filter tests * Avoid destructuring queries from `render` result, use `screen.getByText` instead * another "screen" fix * allow "redundant" story names pending further investigation * reorganize to make sure components are only referenced after they're defined, fix optional chain safety * uncomment test for the time being, will troubleshoot * prepend unused var with `_` * fix describe block name * remove `as default`, make it an explicit default export * allow variables to remain unused if spreading object to remove those keys * Add explicit explanation for empty effect cleanup function * Use `getBy*` queries rather than `queryBy*` for checking element is present `testing-library/prefer-presence-queries` * explicitly use default export instead of `as default` * use `useMemo` to manage SearchKitManager instance to fix `useEffect` dependencies * add swc helpers package to dev dependencies to make jest test suites run successfully * Fix ProvVis test * fix accordion filter tests * Add `buffer` polyfill to make docker image build correctly * Fix maintenance cypress test * remove unnecessary usecallbacks * Update context/app/static/js/components/entity-search/SearchWrapper/utils.spec.js Co-authored-by: John Conroy <[email protected]> * Fix Jest test-utils resolution * remove unnecessary import * Change ProvData constructor to an object --------- Co-authored-by: John Conroy <[email protected]> * remove ESLint changelog that propagated from a merge * Remove `table` from provenance section tests (publications don't have prov tables) * Try waiting before searching for entity header? * force click for vignette test --------- Co-authored-by: John Conroy <[email protected]>
- Loading branch information