-
Notifications
You must be signed in to change notification settings - Fork 80
Version Page - Replaces class by func. #171
Version Page - Replaces class by func. #171
Conversation
Codecov Report
@@ Coverage Diff @@
## master #171 +/- ##
==========================================
- Coverage 88.73% 86.84% -1.89%
==========================================
Files 117 116 -1
Lines 932 882 -50
Branches 147 162 +15
==========================================
- Hits 827 766 -61
- Misses 92 100 +8
- Partials 13 16 +3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review the detail page, it is not loading.
…hub.com:verdaccio/ui into refactor/116_convert_class_to_func_version_page
Hmmm, I need to check this e2e test. The page is loading here, I just tested everything ... but maybe something doesn't match the test |
@priscilawebdev FYI I added E2E (see workflow details), the page does not load, take your time. |
…hub.com:verdaccio/ui into refactor/116_convert_class_to_func_version_page
@juanpicado I have only merged master in this branch and now the e2e tests are passing 🧐 interesting. |
@@ -0,0 +1,9 @@ | |||
function getRouterPackageName(packageName: string, scope?: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to utilities in a new PR, also router is misleading, it just build a package name based on scope. A getPackageName
would fit better here.
import { PackageMetaInterface } from '../../../types/packageMeta'; | ||
|
||
function isPackageVersionValid(packageMeta: Partial<PackageMetaInterface>, packageVersion?: string): boolean { | ||
if (!packageVersion || typeof packageVersion === 'undefined') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also a utilities. The main reason is is much easier to jest.mock
one file rather 10 in the same unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 now it works.
Type: Refactor
The following has been addressed in the PR: #116
Unit or Functional tests are included in the PR?
I updated the current tests
Description:
in order to use react hooks, in this PR I updated the Version Page by changing it from a class to a functional component. I have also splitted it's content so that it is clearer.