-
Notifications
You must be signed in to change notification settings - Fork 51
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
Unit test and documentation #20
Unit test and documentation #20
Conversation
* DUGK-37 iframe test * DUGK-26 Made tests work on iframe. Test coverage added on `yarn test`. --------- Co-authored-by: Asger <asger_bb@hotmail.com>
…de (#15) Made readme for client and developer
* Updated typescript and jest libaries. Added types for react and react-dom. Removed conflicting @jest/globals package Removed all babel, jest is using ts-jest. * Added import of jest-dom to jest.config.json. It's no longer needed in tests. * Build with no warnings and functional test. Re-instaded babel needed for react-scripts to run. Removed transform from jest config and eslint. * Remved jest/globals reference from tests. Slight modification to eslint.
* DUGK-32 Added mock for "ResizeObserver" to setup. Don't know it's behavoir, use at own discretion. * DUGK-32 Unit test for Dashboard with valid mocks * DUGK-32 added back the documentation which have been deleted --------- Co-authored-by: Omar <omarg@live.dk>
client/test/Iframe.test.tsx
Outdated
const { getByTitle } = render(<Iframe url={url} title={title} />); | ||
const iframe = getByTitle(title); | ||
expect(iframe).toHaveProperty('src', url); | ||
it('renders an iframe element with the correct src and title', () => { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
client/test/Iframe.test.tsx
Outdated
const { getByTitle } = render(<Iframe url={url} title={title} />); | ||
const iframe = getByTitle(title); | ||
expect(iframe).toHaveProperty('width', '100%'); | ||
it('sets the iframe width to 100%', () => { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## feature/distributed-demo #20 +/- ##
=============================================================
+ Coverage 0 35.11% +35.11%
=============================================================
Files 0 25 +25
Lines 0 262 +262
=============================================================
+ Hits 0 92 +92
- Misses 0 170 +170
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 12 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Added husky, not configured yet.
* fix codeclimate in iframe test * fixed another codeclimate issue
- Added unittest of workbench
client/test/DigitalTwins.test.tsx
Outdated
expect(true); | ||
}); | ||
|
||
it('renders Dashboard woth components', () => { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
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.
@prasadtalasila So codeclimate is kind of dumb when it comes to test... Is it okay if we exclude test from codeclimate or how do we prevent this redunt code smell?
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.
@SyntaxXeror
Please check codeclimate config docs. If I am not mistaken, there must be a way to skip this problem.
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.
@prasadtalasila you already replyed to this early where you wrote directly from email, so this is fixed :)
client/test/Workbench.test.tsx
Outdated
expect(true); | ||
}); | ||
|
||
it('renders components', () => { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
* DUGK-30 Forward unknown routes to backend Move the layout to individual pages and cleanup the index.tsx * DUGK-30 refactored theme to standalone appprovider. Increases testability. * DUGK-30 Started layout test pretty dirty. * Dugk 32 test suite for page dashboard (#18) * DUGK-32 Added mock for "ResizeObserver" to setup. Don't know it's behavoir, use at own discretion. * DUGK-32 Unit test for Dashboard with valid mocks * DUGK-32 added back the documentation which have been deleted --------- Co-authored-by: Omar <omarg@live.dk> * Minor regex change for test environment * Formatting with prettier. Added husky, not configured yet. * DUGK-30 Fixed duplaction in tests * DUGK-30 added comment * DUGK-30 added another comment * DUGK-30 Moved comment * DUGK-30 Actually solved the issue. Moved grid item up to layout. * DUGK-30 fixed iframe var --------- Co-authored-by: Asger <71492620+SyntaxXeror@users.noreply.github.com> Co-authored-by: Asger <asger_bb@hotmail.com>
Please exclude
From: Asger ***@***.***>
Sent: 27. marts 2023 08:27
To: INTO-CPS-Association/DTaaS ***@***.***>
Cc: Prasad Talasila ***@***.***>; Mention ***@***.***>
Subject: Re: [INTO-CPS-Association/DTaaS] Unit test and documentation (PR #20)
@SyntaxXeror commented on this pull request.
________________________________
In client/test/DigitalTwins.test.tsx<#20 (comment)>:
expect(true);
});
+
+ it('renders Dashboard woth components', () => {
@prasadtalasila<https://github.com/prasadtalasila> So codeclimate is kind of dumb when it comes to test... Is it okay if we exclude test from codeclimate or how do we prevent this redunt code smell?
—
Reply to this email directly, view it on GitHub<#20 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACGHVQX6HPXHYK2OKRIPMOTW6EXMFANCNFSM6AAAAAAWGJRRSU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Added test for History
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.
The PR diff size of 5001 lines exceeds the maximum allowed for the inline comments feature.
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.
The PR diff size of 5076 lines exceeds the maximum allowed for the inline comments feature.
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.
The PR diff size of 5082 lines exceeds the maximum allowed for the inline comments feature.
Added test for route
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.
The PR diff size of 5111 lines exceeds the maximum allowed for the inline comments feature.
* DUGK-34 Test suite created. * DUGK-34 fixed climate issue * DUGK-34 moved test to unittest dir
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.
The PR diff size of 5133 lines exceeds the maximum allowed for the inline comments feature.
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.
The PR diff size of 5133 lines exceeds the maximum allowed for the inline comments feature.
* DUGK-40 Added husky Configured pre-commit to run syntax and format. Locked prettier version Fixed AppProvider * DUGK-41 Now running test on push. Bypass with -y flag. * DUGK-41 Removed failing bypass with '-y' use `HUSKY=0 git push` to bypass * excluded huske from codeclimate * DUGK-41 Fixed build issue * DUGK-41 skip husky on pipeline --------- Co-authored-by: Asger <asger_bb@hotmail.com>
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.
The PR diff size of 5161 lines exceeds the maximum allowed for the inline comments feature.
@prasadtalasila
We also added husky to our pipeline so it runs pre-commit and pre-push:
|
This is great. typicode delivers high-quality packages. The json-server will be useful for testing. I will check this PR by end of today. If everything is ok, will merge the same. |
The git commit hook doesn't seem to work for me.
Am I doing something wrong? Same is the case with
Everything else looks great. |
Re-organizing unittests. Fixed chart test. Fixed husky install Updated readme for husky and format script.
omar@fedora ~/g/D/client (development) [1]> yarn
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
$ cd .. && husky install
husky - Git hooks installed
Done in 0.55s. |
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.
The PR diff size of 5244 lines exceeds the maximum allowed for the inline comments feature.
Code Climate has analyzed commit 9de72f6 and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
b90d574
into
INTO-CPS-Association:feature/distributed-demo
Small update to fix some of the issues from issue #18 :