-
Notifications
You must be signed in to change notification settings - Fork 22
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(react-components) Unit test for UndoManager #5028
Conversation
@@ -82,12 +82,6 @@ export class RevealRenderTarget { | |||
options?: RevealRenderTargetOptions | |||
) { | |||
this._viewer = viewer; | |||
|
|||
const cameraManager = this.cameraManager; |
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 not needed and will give problems in the unit test
@@ -42,10 +40,6 @@ export abstract class BoxDomainObject extends SolidDomainObject { | |||
// OVERRIDES of DomainObject | |||
// ================================================== | |||
|
|||
public override get icon(): IconName { |
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.
Not needed, implementation is already in the base class
@@ -32,10 +30,6 @@ export abstract class CylinderDomainObject extends SolidDomainObject { | |||
// OVERRIDES of DomainObject | |||
// ================================================== | |||
|
|||
public override get icon(): IconName { |
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.
Not needed, implementation is already in the base class
@@ -36,6 +37,8 @@ export const cameraManagerMock = new Mock<CameraManager>() | |||
}) | |||
.setup((p) => p.getCameraState()) | |||
.returns(cameraManagerGlobalCurrentCameraState as Required<CameraState>) | |||
.setup((p) => p.getCamera) |
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.
Added this to the ,mock. It is needed.
@@ -43,4 +43,16 @@ export const viewerMock = new Mock<Cognite3DViewer<DataSourceType>>() | |||
.returns(fitCameraToModelsMock) | |||
.setup((p) => p.requestRedraw) | |||
.returns(vi.fn()) | |||
.setup((p) => p.on) |
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.
Also needed in the unit tests
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5028 +/- ##
==========================================
+ Coverage 23.69% 24.31% +0.61%
==========================================
Files 686 686
Lines 36817 36809 -8
Branches 1275 1368 +93
==========================================
+ Hits 8725 8949 +224
+ Misses 27816 27584 -232
Partials 276 276
🚀 New features to boost your workflow:
|
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.
LGTM
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.
🦄
Type of change
Description 📝
This test the classes