assertaction

package
v1.9.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package assertaction provides testing functions for validation a plugin action's behavior

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchesAndAnswers

func MatchesAndAnswers(t *testing.T, action slackscot.ActionDefinition, m *slackscot.IncomingMessage, validateAnswer AnswerValidator) bool

MatchesAndAnswers asserts that the action.Match is true and gets the action's answer to be further validated by AnswerValidator

func MatchesAndEmojiReacts added in v1.9.0

func MatchesAndEmojiReacts(t *testing.T, plugin *slackscot.Plugin, action slackscot.ActionDefinition, m *slackscot.IncomingMessage, expectedEmojis ...string) bool

MatchesAndEmojiReacts asserts that the action.Match is true and validates that expected emojis reactions are added to the message

func NotMatch

NotMatch asserts that action.Match is false

Types

type AnswerValidator

type AnswerValidator func(t *testing.T, a *slackscot.Answer) bool

AnswerValidator is a function to do further validation of an action's answer. The return value is meant to be true if validation is successful and false otherwise (following the testify convention)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL