repo_description: Open-source cloud-environment inspector. Supporting AWS, GCP, Azure, and more! Your cloud resources will have nowhere to hide!
repo_topics: aws azure civo cost-optimization digitalocean gcp hacktoberfest inventory-management kubernetes linode oci open-source tencent
code: package internal
  
  import (
  	"testing"
  
  	"github.com/stretchr/testify/assert"
  )
  
  func TestSlackAttachment(t *testing.T) {
  	// default - no slack host specified in config
  	attachment := createSlackAttachment("testViewName", 3000, 101, 99, 99.99, "", "RESOURCES")
  	expectedActionUrl := "http://localhost:3000/inventory?view=101"
  	assert.Equal(t, expectedActionUrl, attachment.Actions[0].URL)
  
  	// explicit - slack host specified in config
  	attachment = createSlackAttachment("testViewName", 3000, 101, 99, 99.99, "https://example.com", "RESOURCES")
  	expectedActionUrl = "https://example.com/inventory?view=101"
  	assert.Equal(t, expectedActionUrl, attachment.Actions[0].URL)
  }
  