| 1 | package slackscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.16 testing/" |
| 5 | |
| 6 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.2.2 `github.com/stretchr/testify/assert`/" |
| 7 | ) |
| 8 | |
| 9 | func TestNewContextBlockscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/TestNewContextBlock().(t *testingscip-go gomod github.com/golang/go/src go1.16 testing/.Tscip-go gomod github.com/golang/go/src go1.16 testing/T#) { |
| 10 | |
| 11 | locationPinImage := NewImageBlockElementscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/NewImageBlockElement().("https://api.slack.com/img/blocks/bkb_template_images/tripAgentLocationMarker.png", "Location Pin Icon") |
| 12 | textExample := NewTextBlockObjectscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/NewTextBlockObject().("plain_text", "Location: Central Business District", true, false) |
| 13 | |
| 14 | elements := []MixedElementscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/MixedElement#{locationPinImage, textExample} |
| 15 | |
| 16 | contextBlock := NewContextBlockscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/NewContextBlock().("test", elements...) |
| 17 | assertscip-go gomod github.com/stretchr/testify v1.2.2 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.2.2 `github.com/stretchr/testify/assert`/Equal().(t, string(contextBlock.Typescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ContextBlock#Type.), "context") |
| 18 | assertscip-go gomod github.com/stretchr/testify v1.2.2 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.2.2 `github.com/stretchr/testify/assert`/Equal().(t, contextBlock.BlockIDscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ContextBlock#BlockID., "test") |
| 19 | assertscip-go gomod github.com/stretchr/testify v1.2.2 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.2.2 `github.com/stretchr/testify/assert`/Equal().(t, len(contextBlock.ContextElementsscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ContextBlock#ContextElements..Elementsscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ContextElements#Elements.), 2) |
| 20 | |
| 21 | } |