DEV: Don't try to vibrate in test mode (#17405)

It ends up just triggering an error:

```
[Intervention] Blocked call to navigator.vibrate because user hasn't tapped on the frame or any embedded frame yet: https://www.chromestatus.com/feature/5644273861001216.
```
This commit is contained in:
Jarek Radosz 2022-07-10 10:53:00 +02:00 committed by GitHub
parent 9365d4e86a
commit f19f804525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@ import {
NO_REMINDER_ICON,
WITH_REMINDER_ICON,
} from "discourse/models/bookmark";
import { isTesting } from "discourse-common/config/environment";
const LIKE_ACTION = 2;
const VIBRATE_DURATION = 5;
@ -721,7 +722,7 @@ export default createWidget("post-menu", {
return this.sendWidgetAction("showLogin");
}
if (this.capabilities.canVibrate) {
if (this.capabilities.canVibrate && !isTesting()) {
navigator.vibrate(VIBRATE_DURATION);
}