owncloud / web-app-dicom-viewer

ownCloud Web DICOM Viewer is an extension of ownCloud Web to preview DICOM files (medical images and their corresponding metadata)
GNU Affero General Public License v3.0
3 stars 1 forks source link

Add missing mock function #59

Closed Salipa-Gurung closed 3 months ago

Salipa-Gurung commented 3 months ago

Description

This pr adds mock for setCamera.

Related Issue

Motivation and Context

Unit test failed because of missing setCamera mock function in https://github.com/owncloud/web-app-dicom-viewer/pull/56.

⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
TypeError: this.viewport.setCamera is not a function
 ❯ Proxy.setZoom src/App.vue:630:21
    628|       }
    629| 
    630|       this.viewport.setCamera(newCamera)
       |                     ^
    631|       this.viewport.render()
    632|     },
 ❯ Proxy.mounted src/App.vue:263:12

This error originated in "tests/unit/App.spec.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
The latest test that might've caused the error is "should fetch overlay metadata when the url is provided". It might mean one of the following:
- The error was thrown, while Vitest was running this test.
- If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Types of changes

Checklist:

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud