FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

PF4: (virtualized-extension) jest tests for VirtualizedTable by jenny-s51 · Pull Request #2761 · patternfly/patternfly-react · GitHub

PF4: (virtualized-extension) jest tests for VirtualizedTable - #2761

Merged
mturley merged 15 commits into
patternfly:masterfrom
jenny-s51:iss2328
Oct 25, 2019
Merged

PF4: (virtualized-extension) jest tests for VirtualizedTable#2761
mturley merged 15 commits into
patternfly:masterfrom
jenny-s51:iss2328

Conversation

jenny-s51 commented Aug 22, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

WIP for #2328 -- currently working on resolving these type errors shown after running yarn run jest virtualizedTable.

jenny-s51 requested a review from priley86 August 22, 2019 19:43

jenny-s51 commented Aug 23, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

Resolving TS errors with any type for now. Can change the types to what's more appropriate, but need some feedback on what would be best here. In addition, /Virtualized and/Virtualized/utils are now showing up in the coverage report, but coverage still really needs to be improved (13.23% and 19.29%, respectively). Will be working on this.

export const TextSize: any;
}

declare module 'linear-layout-vector' {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

hey @jenny-s51 - my only ounce of feedback so far here would be - can we move this declaration into patternfly-4/react-virtualized-extension some place? I believe linear-layout-vector is only a dependency of that package (so probably unnecessary in react-core).

Also, i think you can safely remove package-lock.json as well. We don't ship lock files to consumers (just reference the dependences in the package.json for each package) and all of the dev dependencies for PF React end up getting locked in the root yarn.lock file (which should update when you install new packages or run yarn install in the root).

Great job w/ this, it's a huge help!!! ⭐️

priley86 commented Sep 9, 2019

Copy link
Copy Markdown
Member

hey @jenny-s51 - i've pushed a commit w/ some proposed changes to this PR today:
https://github.com/priley86/patternfly-react/commits/iss2328

Let me know what you think. I'm mostly happy here aside from one warning in the jest log still...

 PASS  packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualizedTable.test.tsx
  ● Console

    console.error node_modules/prop-types/checkPropTypes.js:20
      Warning: Failed prop type: Invalid prop `children` supplied to `Table`, expected a ReactNode.
          in Table
    console.error packages/patternfly-4/react-table/dist/js/components/Table/Table.js:237
      Table: Specify at least one of: header, caption, aria-label
    console.error node_modules/prop-types/checkPropTypes.js:20
      Warning: Failed prop type: Invalid prop `children` supplied to `Provider`, expected a ReactNode.
          in Provider (created by Table)
          in Table (created by WrapperComponent)
          in WrapperComponent
    console.error node_modules/react-dom/cjs/react-dom.development.js:180
      Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Componen
t /> from render. Or maybe you meant to call this function rather than return it.
          in table (created by Provider)
          in Provider (created by Table)
          in Table (created by WrapperComponent)
          in WrapperComponent
    console.error packages/patternfly-4/react-table/dist/js/components/Table/Table.js:237
      Table: Specify at least one of: header, caption, aria-label

Did not get a chance to address it. I will try testing these changes downstream tomorrow and report back though!

Copy link
Copy Markdown
Collaborator

PatternFly-React preview: https://patternfly-react-pr-2761.surge.sh

dropdownPosition?: 'right' | 'left';
dropdownDirection?: 'up' | 'down';
rows: (IRow | string[])[];
rows?: (IRow | string[])[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍

Comment thread package.json Outdated
]
},
"dependencies": {
"@types/react-virtualized": "^9.21.4"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

i don't think this is needed in the root anymore since we've added it in react-virtualized-extension's package.json

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

how would you suggest I address this? would it just be yarn remove @types/react-virtualized?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think so, yes, or you could remove the line from the package.json and re-run yarn install. If the build still passes without this dependency in here, yeah, I think remove it. But it's probably ok either way.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You can delete the line. Likely no need to re-run yarn install, but better safe than sorry.

expect(view).toMatchSnapshot();
});

test('Header only table', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍

/* eslint-disable */

import LinearLayoutVector from 'linear-layout-vector';
const LinearLayoutVector = require("linear-layout-vector");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

is this still necessary? (changing import to require)

Copy link
Copy Markdown
Member

hey @jenny-s51 - i'm mostly OK w/ this change. I would just remove any package-lock.json files (since we havent been checking those in)

mturley commented Sep 25, 2019

Copy link
Copy Markdown
Contributor

@jenny-s51 +1 about package-lock.json.. and actually, if that file is being created you're probably using the npm CLI, I'd make sure you're running yarn install instead of npm install because we do want any updates to yarn.lock 🙂

Copy link
Copy Markdown
Contributor Author

@priley86 do you mean I can just remove package-lock.json from this PR entirely?

Copy link
Copy Markdown
Contributor

@jenny-s51 We use yarn with yarn.lock to install packages, so yes please remove package-lock.json!

Copy link
Copy Markdown
Contributor Author

@redallen gotcha, should be all set now -- thank you!

codecov-io commented Oct 15, 2019
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #2761 into master will decrease coverage by 2%.
The diff coverage is 36.36%.

@@            Coverage Diff             @@
##           master    #2761      +/-   ##
==========================================
- Coverage   69.13%   67.12%   -2.01%     
==========================================
  Files         868      873       +5     
  Lines       23777    24490     +713     
  Branches     1932     2071     +139     
==========================================
+ Hits        16438    16439       +1     
- Misses       6360     7088     +728     
+ Partials      979      963      -16
Flag Coverage Δ
#misc 95.45% <ø> (ø) ⬆️
#patternfly3 69.3% <ø> (ø) ⬆️
#patternfly4 63.99% <36.36%> (-4.3%) ⬇️
Impacted Files Coverage Δ
...ts/Virtualized/utils/CellSizeAndPositionManager.ts 16.49% <ø> (ø)
...src/components/Virtualized/utils/animationFrame.ts 27.27% <ø> (ø)
...onents/Virtualized/utils/createCallbackMemoizer.ts 0% <0%> (ø)
...components/Virtualized/defaultCellRangeRenderer.ts 1.81% <0%> (ø)
...on/src/components/Virtualized/VirtualTableBody.tsx 18.96% <0%> (ø)
...ualized/utils/ScalingCellSizeAndPositionManager.ts 27.94% <100%> (ø)
...nents/Virtualized/utils/requestAnimationTimeout.ts 27.27% <100%> (ø)
...xtension/src/components/Virtualized/VirtualGrid.ts 9.3% <33.33%> (ø)
...-4/react-core/src/components/TextArea/TextArea.tsx 93.75% <0%> (-1.71%) ⬇️
...ly-4/react-core/src/components/Tooltip/Tooltip.tsx 84.48% <0%> (-0.27%) ⬇️
... and 30 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 672047a...48756dd. Read the comment docs.

jenny-s51 force-pushed the iss2328 branch 3 times, most recently from 36a8485 to 5713a58 Compare October 15, 2019 22:45
jenny-s51 requested a review from mturley October 25, 2019 16:54
mturley merged commit bb31325 into patternfly:master Oct 25, 2019
jenny-s51 deleted the iss2328 branch October 25, 2019 17:21
redallen added a commit to redallen/patternfly-react that referenced this pull request Oct 28, 2019
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL