bUnit's JSInterop has not been configured to handle the call InvokeAsync<GetDeviceInfoResult> #1776
-
|
Hi everyone, i'm trying to create a bUnit test for my component. this is a wrapper for the DevExpress DxDropDownButtonItem. this is my wrapper component and this is my bUnit test: when im debugging, this is what the message says: is there anyway i could fix it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
There are multiple ways. I am no expert on DevExpress, so can only give "general" advise here. First and foremost, you could just mock the call as described, You did export const UtilsModule = {
getDeviceInfo() { ... }
}Now here a bit of salt. There is a different route you can take: Substituting (mocking) components. If you have a unit test, you don't want to rely on 3rd party behavior. So you can create your own fake/stub of |
Beta Was this translation helpful? Give feedback.
There are multiple ways. I am no expert on DevExpress, so can only give "general" advise here.
First and foremost, you could just mock the call as described, You did
getDeviceInfobut the JS Call in questionUtilsModule.getDeviceInfo. Assuming DevExpress defines those types like:Now here a bit of salt. There is a different route you can take: Substituting (mocking) components. If you have a unit test, you don't want to rely on 3rd party behavior. So you can create your own fake/stub of
DxDropDownButtonthat mimicks the public API (akaParameterAttributeand so on). Bring the 3rd party component under your control!