René Winkelmeyer
René Winkelmeyer
Did you stub it? https://github.com/trailheadapps/lwc-recipes/blob/master/force-app/test/jest-mocks/lightning/platformShowToastEvent.js
`ShowToastEventName` is not exported, as @damianpoole already pointed out. That's one of the changes in the custom mock that I shared. You would have to hardcode `lightning__showtoast` in your test,...
Also see [here](https://github.com/trailheadapps/lwc-recipes/blob/master/jest.config.js#L11-L12) the Jest config to us the mock. Using this custom mock for `platformShowToastEvent` is also described in the official LWC Jest documentation [here](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.unit_testing_using_jest_patterns) (search for `Module Imports`).
@edmondo1984 Do you use the stub that I linked?
As mentioned earlier: If you want to test any of the details, like variant, message etc, you'd have also to use the custom mock.
Because the `detail` property of the CustomEvent is not included in the default provided mock, that's the [relevant modification](https://github.com/trailheadapps/lwc-recipes/blob/master/force-app/test/jest-mocks/lightning/platformShowToastEvent.js#L15) in our custom version.
Thanks for reaching out. Can you please elaborate what is not working. I just ran an installation using [the provided script](https://github.com/trailheadapps/az-insurance/blob/main/bin/install-scratch.sh) (although there is nothing special in there). After doing...
Did you follow the manual instructions, or did you use the provided script?
Change looks good. I can add my dashboard. That's in InfluxQL, but if I recall correctly you're moving to Flux, no?
Feel free to release. Still reading through Flux documentation...