Documentation
    Preparing search index...

    Type Alias MockNotifyService

    MockNotifyService: MockService<MockNotifyState> & {
        interact(
            notificationId: string,
            interaction: string | MockNotifyInteraction,
        ): boolean;
    }

    The notify mock service with its interact control.

    Type Declaration

    • interact: function
      • Simulate the user interacting with a notification and push the matching notify.action, notify.clicked, or notify.dismissed to its window. A string is 'clicked', 'dismissed', or an action id.

        Parameters

        • notificationId: string

          Shell-assigned id from notify.send.result.

        • interaction: string | MockNotifyInteraction

          What the user did.

        Returns boolean

        false when the id or action is unknown (nothing is pushed).

    const notify = createMockNotifyService();
    notify.interact('shell-1', 'clicked');
    notify.interact('shell-1', { type: 'dismissed', reason: 'timeout' });